Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

enhance(editor): confirm before reset #2052

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

caugner
Copy link
Contributor

@caugner caugner commented Nov 14, 2024

Fixes #1739.

@caugner caugner requested a review from a team as a code owner November 14, 2024 11:59
@caugner caugner changed the title enhance(editor): confirm before reset/reload enhance(editor): confirm before reset Nov 14, 2024
@bsmth bsmth self-requested a review November 14, 2024 12:54
@@ -95,7 +95,12 @@ import "../css/editable-css.css";
function handleResetEvents() {
const resetButton = document.getElementById("reset") as HTMLElement;

resetButton.addEventListener("click", () => {
resetButton.addEventListener("click", (event) => {
if (!window.confirm("Do you really want to reset everything?")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the copy, I like wording like this:

Are you sure you want to reset the editor?
Any changes you have made will be lost.

-> OK / Cancel

Copy link
Member

@bsmth bsmth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, one minor comment about copy, but it's working well! 👍🏻

Thank you!

Co-authored-by: Brian Thomas Smith <brian@smith.berlin>
@caugner caugner requested a review from bsmth November 14, 2024 22:48
Copy link
Member

@bsmth bsmth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a confirmation dialog when pressing "Reset" on the "Try it" live code examples
2 participants