Opened 8 years ago

Closed 7 years ago

#4922 closed bug (fixed)

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@…
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

Change History (5)

comment:1 Changed 8 years ago by bohdan.ganicky

Component: ui.coreui.dialog

comment:2 Changed 7 years ago by Jörn Zaefferer

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.

comment:3 Changed 7 years ago by bohdan.ganicky

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

comment:4 Changed 7 years ago by btburnett3

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.

comment:5 Changed 7 years ago by Scott González

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.