Skip to content

Comments

fix(uber_search): prevent esc key hiding select options#29

Open
melonunderground wants to merge 2 commits intoculturecode:masterfrom
melonunderground:23265-esc-key-disables-menus
Open

fix(uber_search): prevent esc key hiding select options#29
melonunderground wants to merge 2 commits intoculturecode:masterfrom
melonunderground:23265-esc-key-disables-menus

Conversation

@melonunderground
Copy link
Contributor

  • move Esc pane-hide from global pane.js to uber_search.js
  • prevent panes being hidden with no selectable/visible options

- move Esc pane-hide from global pane.js to uber_search.js
- prevent panes being hidden with no selectable/visible options
})

// Hide the pane when the user presses escape
$(view).on('keyup', function(event){
Copy link
Member

Choose a reason for hiding this comment

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

If we attach the escape key handler to the search element instead of the document, then I would have to be focussed in the search instead of anywhere on the page. Could we pass in the alwaysOpen option to the constructor instead so it can remain where it was and we just don't attach the handler? I don't believe we expect to change the options after instantiating the UberSearch (though you'd need to confirm this through some code spelunking).

- esc key close handled in pane
- pass alwaysOpen from UberSearch to pane
- skip esc close when alwaysOpen true
- update is safe as options is only read, not mutated
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.

2 participants