Search and Top Navigation
#8107 closed bug (fixed)
Opened February 08, 2012 05:56PM UTC
Closed February 08, 2012 06:43PM UTC
Last modified February 08, 2012 06:44PM UTC
Closing the datepicker via the provided button does not work in Chrome when the button contains other non-text elements.
Reported by: | N3RD | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.8.18 |
Component: | ui.datepicker | Version: | 1.8.17 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Browser: Chrome
OS: Windows
Test case: http://jsbin.com/oyubil/2/
Attempted solution: https://github.com/jquery/jquery-ui/pull/591
If other non-text elements are injected into the provided button using the buttonText option, clicking the button while the datepicker is open does a couple weird things. First, it closes as expected, but then reopens immediately after. Second, it loses the document.mousedown handler that cause it to close when something other than the datepicker is clicked on. Although not an issue per se, in Firefox there is a slight pause before the datepicker closes (at least it closes).
My solution was to change the document.mousedown handler to a document.click handler. But this broke the next and previous anchor buttons. My solution to fix that was to put a stopPropagation call inside the click handlers for those anchors, but I guess that's not the right way to do it.
This issue is kind of important because it limits the ability to style the button.
Datepicker: Allow descendant elements in triggers. Fixes #8107 - Closing the datepicker via the provided button does not work in Chrome when the button contains other non-text elements.
Changeset: c964894b9b75dc7df62660725967a1f7a526a3ec