#9561 closed bug (notabug)
Jquery UI datepicker not closing on escape key as you would expect
Reported by: | ranjith19 | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | none |
Component: | ui.datepicker | Version: | 1.10.3 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
have a look at http://jsfiddle.net/SYwpy/189/ to get a sense of what I am talking about
Below is the code for your ref
$(document).ready(function() { $('#input').datepicker({ }); });
<input id="input"> <div id="output"></div>
- Click on the text box
- Hit escape.
- Go away from the browser window or tab.
- Then come back
- Datetpicker is still there
I guess the browser fires a fucus event again when you get back to the window. Is it something wrong with Jquery date picker or something wrong with the browser?
There is another related problem
Also another related problem gets solved which is
- Click on the input
- Hit escape
- Repeatedly clicking the input field will not allow you to see datepicker again unless you click somewhere else and come back
This is because there is no focus event fired second time.
In any case what I have been doing to circumvent this is http://jsfiddle.net/SYwpy/190/
$(document).ready(function() { $('#input').datepicker({ onClose: function(){$(this).blur()} }); });
This solves both the issues I have mentioned.
Change History (3)
comment:1 Changed 10 years ago by
comment:2 Changed 10 years ago by
Resolution: | → notabug |
---|---|
Status: | new → closed |
There is no bug here. If there's a focus event, you get the datepicker; if there isn't, you don't.
comment:3 Changed 10 years ago by
The first half is normal browser behavior.
For the second half though (click after escape keypress), I'm not sure what the datepicker should do. Our rewrite DOES reopen the datepicker on a click after escape so the behavior will be changing.
Though the fiddles I have mentioned are of a different jquery ui version, the bug still exists in 1.10.3
Updated fiddles http://jsfiddle.net/SYwpy/192/
http://jsfiddle.net/SYwpy/191/