You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 6, 2021. It is now read-only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SAplayer, can you make this work for the shortcut key (CTRL+ALT+R) as well? The old code probably needs to be cleaned up a bit because, for some reason, the key event handler and the mouse event handler have been separated out and now they act differently, which is bad. Both events should call the same handler so the behavior is the same regardless of whether you click the button or you hit the shortcut key.
@lkcampbell I tried to, but I don't get it to work. For some reason, I can't access $dropdown from handleKeyEvent.
Just try to add console.log($dropdown); to the first line of handleKeyEvent, and you will either get undefined or null. It works just fine in handleMouseEvent.
@lkcampbell I'm not totally convinced they should have exactly the same behavior, at least not the way the dropdown is currently constructed. When you open it from the keyboard, it selects the first folder as a convenience. However, when you click on it with the mouse, I'm not sure it would make sense to highlight an item before you mouse over it.
(In typical OS dropdowns, when you click on the button, the currently selected item is highlighted, and on the Mac, it actually positions the popup so that the selected item is over the dropdown button and therefore under the mouse initially. However, the project menu doesn't actually show the current project, since it was intended to act like a recent files list.)
@njx, that's fine, I just figured it was a fairly subtle UI difference that didn't hurt the mouse click behavior. I'm more concerned about having two functions that need to be kept in sync instead of just one.
Change looks good. @njx any reservations about changing the behavior? This feels like how OS combo/menu affordances work so I'm good with taking it as-is.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
None yet
4 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It hides the dropdown when you click on the button again (the behaviour before was really confusing to me)