Ticket #4922 (closed bug: fixed)

Opened 5 years ago

Last modified 5 years ago

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@…
Blocking: Blocked by:

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

comment:1 Changed 5 years ago by bohdan.ganicky

  • Component changed from ui.core to ui.dialog

comment:2 Changed 5 years ago by joern.zaefferer

  • 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 5 years ago by bohdan.ganicky

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

comment:4 Changed 5 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 5 years ago by scott.gonzalez

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