Skip to main content

Search and Top Navigation

#4922 closed bug (fixed)

Opened October 20, 2009 01:44PM UTC

Closed February 23, 2010 02:36AM UTC

window.location.reload() doesn't work in dialog's close callback when it's triggered by ESC in Firefox

Reported by: bohdan.ganicky Owned by:
Priority: major Milestone: 1.8
Component: ui.dialog Version: 1.7.2
Keywords: Cc: bohdan.ganicky@gmail.com
Blocked by: Blocking:
Description

code:

$('#dialog').dialog({
  close: function() {
    window.location.reload();
  }
});
 

expected behavior:

  • when I press ESC on focused dialog, dialog is closed and page is reloaded
  • when I click close (X) button on dialog's header, dialog is closed and page is reloaded

actual behavior:

  • dialog is closed but page IS NOT reloaded when I press ESC in Firefox
  • dialog is closed and page is reloaded properly when I click close (X) button on dialog's header

testcase:

http://jsbin.com/aheyo

Attachments (0)
Change History (5)

Changed October 20, 2009 01:44PM UTC by bohdan.ganicky comment:1

component: ui.coreui.dialog

Changed November 17, 2009 08:27AM UTC by jzaefferer comment:2

milestone: TBD1.8

There shouldn't be any difference, both the ESC-keyhandler and the x-icon-click-handler use the close-method, which triggers the close-event.

Changed November 22, 2009 03:25PM UTC by bohdan.ganicky comment:3

Exactly. It's weird but it's so. :(

Changed February 22, 2010 06:39PM UTC by btburnett3 comment:4

My best guess is that Firefox is responding to the escape like you're hitting the stop button, which cancels the current load (or reload in this case). Fixed in r3839 by canceling the keydown event for the ESC key after it is handled.

Changed February 23, 2010 02:36AM UTC by scottgonzalez comment:5

resolution: → fixed
status: newclosed