Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#8107 closed bug (fixed)

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.

Change History (2)

comment:1 Changed 11 years ago by Scott González

Resolution: fixed
Status: newclosed

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

comment:2 Changed 11 years ago by Scott González

Milestone: 1.91.8.18
Note: See TracTickets for help on using tickets.