Skip to main content

Search and Top Navigation

#7540 closed bug (notabug)

Opened July 11, 2011 01:05PM UTC

Closed July 11, 2011 02:19PM UTC

Unusual Button Behavior in jQueryUi Modal Dialog

Reported by: photo_tom Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.dialog Version: 1.8.14
Keywords: Cc:
Blocked by: Blocking:
Description

I have a jQueryUi Modal dialog up and running correctly based on an Asp.Net MVC3 partial view. For all but one of the fields, pressing the CANCEL button does what is expected. The button click handler function in the dialog options is called and dialog.close() is called. You can see it at http://jsfiddle.net/photo_tom/YA87Y/6/.

When any field is for entry is clicked on, there is some JavaScript that runs that highlights the label and the input control by adding a css class tag to the table row that both are in.

Last Name field is different in that it is a textarea control with some events attached dynamically for displaying the number of reaming characters the user can enter. Pressing the CANCEL button while this field has focus, initially causes the field to loose focus and the function on the CANCEL button function in the dialog options is not called. The second time you press the CANCEL button, the dialog will close properly.

This form works properly in FF5, it works as described above in Chrome 12, IE9 and IE9 in IE8 compatibility mode.

Attachments (0)
Change History (1)

Changed July 11, 2011 02:19PM UTC by rdworth comment:1

_comment0: This is not a jQuery UI bug. Here's a minimal test case showing it's simply the way the browser behaves when the onblur callback moves the element that was being clicked that cause the blur: http://jsbin.com/agezas \ \ As a workaround, you can call the removeClass in a setTimeout. Quick test shows you'll want to allow maybe 20 milliseconds1310393978802868
resolution: → invalid
status: newclosed

This is not a jQuery UI bug. Here's a minimal test case showing it's simply the way the browser behaves when the onblur callback moves the element that was being clicked that caused the blur: http://jsbin.com/agezas

As a workaround, you can call the removeClass in a setTimeout. Quick test shows you'll want to allow maybe 20 milliseconds