operasoftware / dns-ui

Opera's LDAP-authenticated PowerDNS user interface
Apache License 2.0
283 stars 57 forks source link

Save changes button triggers Leave site? dialog in Chrome 72.0.3626.119 #127

Closed jsoref closed 5 years ago

jsoref commented 5 years ago
  1. visit /dnsui/zones/example.com
  2. click the blank row
  3. name: a
  4. type: a
  5. content: 127.0.0.1
  6. click + Add
  7. click Save changes

Actual results: image

Clicking the Leave button results in the changes being saved. But this workflow is suboptimal.

Note: Closing the tab (e.g. w/ cmd-w) results in the same dialog, which means that one can't tell when the dialog is warning about actual dataloss or content submission.

thomas-pike commented 5 years ago

I cannot reproduce the problem here (tested on Vivaldi 2.3.1440.60 with Chromium 72.0.3626.122). It is certainly supposed to appear (by design) when closing the tab, but the javascript code is supposed to prevent it from displaying when actually saving changes.

jsoref commented 5 years ago

I'm hitting an exception here: https://github.com/operasoftware/dns-ui/blob/000e9f3aca0f370c3d84f763b5dfab3a295d4bb3/public_html/extra.js#L604 form.data is not a function.

We're running https://github.com/operasoftware/dns-ui/commit/678206a33849ca9783d90419aba2b99b2447751f

thomas-pike commented 5 years ago

Interesting. Very interesting.

Looks like the bug was introduced in fc410df (specifically this line) but I'm not sure why I'm not seeing the effects of this bug.

thomas-pike commented 5 years ago

Regardless of me not being able to reproduce the error, the code is clearly broken. Please try #128 and see if that resolves it for you.