Skip to content
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

Close infinite editors with the esc key #3895

Closed
madsrasmussen opened this issue Dec 17, 2018 · 5 comments
Closed

Close infinite editors with the esc key #3895

madsrasmussen opened this issue Dec 17, 2018 · 5 comments

Comments

@madsrasmussen
Copy link
Contributor

No description provided.

@madsrasmussen
Copy link
Contributor Author

PR: #3896

The PR implements a global way to close infinite editors with the ESC key so each infinite editor doesn't have to do the implementation themselves. This also means that it requires a "close" callback function on the infinite editor for this to work. We have to do it this way so we make sure that if any logic has to be run when an infinite editor is closed still works.

How to test:

  • Open a couple of infinite editors (Ex. add a property to a doctype)
  • Make sure you can close them using the "Esc" key.

@madsrasmussen
Copy link
Contributor Author

I am closing this PR again as it is not the correct solution. We will have to control the shortcut from within each infinite editor so we are sure that all logic that needs to be run is run.

It can probably be solved the same way as with any other shortcut in infinite editors just to bind the keyboard shortcut to the close button by using the "shortcut" attribute and bind it to "esc".

@elit0451
Copy link
Member

elit0451 commented Dec 27, 2018

Shortcuts to the close buttons on infinite editors are being added. PR: #3933

Remark!
After closing an editor that isn't the first one opened, the 'esc' shortcuts for the rest of the editors don't seem to work! Suggestions will be appreciated!

@elit0451 elit0451 removed their assignment Dec 27, 2018
@clausjensen clausjensen modified the milestones: sprint100, sprint101 Jan 4, 2019
@robert-cpl
Copy link
Contributor

@elit0451, it turns out that we have to rebind the keyboard shortcuts after the animation is done upon closing the editor with the esc key.
The reason is that the editor is not removed until the animation is done.

I found out that a 0 ms timeout around rebindKeyboardShortcuts(); does the trick.

Also, found out that the esc shortcut does not work on media picker editor - a quick inspection on the close button showed me that there is no shortcut added.

@elit0451
Copy link
Member

elit0451 commented Jan 9, 2019

Changes added 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants