Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Tooltip/Popover close on escape broken #6108

Closed
iamfozzy opened this issue Jul 21, 2016 · 3 comments
Closed

Tooltip/Popover close on escape broken #6108

iamfozzy opened this issue Jul 21, 2016 · 3 comments

Comments

@iamfozzy
Copy link
Contributor

There is an issue with Chrome and potentially other browsers with capturing 'escape' for a 'keypress' event.

This is preventing the ui-bootstrap tooltip (and popovers) from closing on press of escape key.

This should be changed to keydown or keyup here: https://github.com/angular-ui/bootstrap/blob/master/src/tooltip/tooltip.js#L74

I will submit a PR with a fix shortly.

@icfantv
Copy link
Contributor

icfantv commented Jul 21, 2016

@stuartforster, i can confirm that the event is not fired when keypress is used. i will also confirm that changing to keyup or keydown does not cause the tooltip/popover to be closed.

what trigger do you expect this to work with? also, please note that any code change will require tests.

@iamfozzy
Copy link
Contributor Author

Thanks @icfantv, trigger could be keyup or keydown, I think keyup probably makes most sense.

I'll investigate why the popover still doesn't close even when the event is firing.

I will include tests with any PR I submit.

@icfantv
Copy link
Contributor

icfantv commented Jul 21, 2016

@stuartforster, after a thorough investigation, it appears the tooltip reference inside the close handling sequence is not defined meaning when the actual close route is executed, nothing happens and the tooltip stays open.

Here's a plunker to get you started. I've already set the event to keyup. Set a breakpoint at line 4724 and trace through and you'll see that ultimately the reference to tooltip is not defined which results in 4988 not being executed.

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

No branches or pull requests

3 participants