Opened 7 years ago

Closed 6 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 7 years ago by bohdan.ganicky

  • Component changed from ui.core to ui.dialog

comment:2 Changed 6 years ago by jzaefferer

  • Milestone changed from TBD to 1.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 6 years ago by bohdan.ganicky

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

comment:4 Changed 6 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 6 years ago by scottgonzalez

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.