Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Clicking project-dropdown-toggle again closes the dropdown #5435

Merged
merged 1 commit into from
Oct 21, 2013

Conversation

marcelgerber
Copy link
Contributor

It hides the dropdown when you click on the button again (the behaviour before was really confusing to me)

@ghost ghost assigned JeffryBooher Oct 11, 2013
@lkcampbell
Copy link
Contributor

@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.

@marcelgerber
Copy link
Contributor Author

@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.

Can anybody of you maybe take a look at it?

@njx
Copy link
Contributor

njx commented Oct 15, 2013

@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.)

@lkcampbell
Copy link
Contributor

@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.

@JeffryBooher
Copy link
Contributor

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.

JeffryBooher added a commit that referenced this pull request Oct 21, 2013
Clicking project-dropdown-toggle again closes the dropdown
@JeffryBooher JeffryBooher merged commit 535646b into adobe:master Oct 21, 2013
@marcelgerber marcelgerber deleted the recent-projects-toggle branch October 22, 2013 14:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants