Skip to content

Fix multiple save-as prompts #541

New issue

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

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

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed

Fix multiple save-as prompts #541

wants to merge 3 commits into from

Conversation

nol166
Copy link
Contributor

@nol166 nol166 commented Apr 18, 2019

Describe in detail the problem you had and how this PR fixes it

The save as overlays open on top of each other if invoked before dismissing. This checks to see if there is an overlay present before spawning another one.

Is there an open issue you can link to?

fixes #536

@nol166 nol166 requested a review from code-asher April 18, 2019 21:35
@nol166 nol166 requested a review from kylecarbs as a code owner April 18, 2019 21:35
@kylecarbs
Copy link
Member

How is a dialog displayed twice? This feels like more of a patch and less of a fix.

@nol166
Copy link
Contributor Author

nol166 commented Apr 24, 2019

@kylecarbs If the prompt is already open and the user presses the keybind again, it opens a second prompt

@code-asher
Copy link
Member

code-asher commented Apr 25, 2019

One solution that might work (this is untested) is something like:

overlayDiv.addEventListener("keydown", (event) => {
  event.preventDefault();
});

Could also bind escape in there while we're at it to close the dialog.

But this might prevent typing from working in the "save as" dialog. Maybe in that case we can preventDefault on the input instead. But there might be a more clever way to keep the keypresses from escaping the overlay div while still working inside it.

We discovered this does not work. The event must propagate all the way up for the input to work. 🤷‍♂️ We'd have to create a custom input or something to go this route.

@code-asher code-asher closed this Jul 2, 2019
@code-asher code-asher deleted the fix/save-as branch July 2, 2019 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Save shortcut triggers even when save dialog is open
3 participants