Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] web: drop event during click() dispatching if disabled
Causes the failure of [0] on FF as it expects that clicking a disabled button does nothing, which is what happens for Chrome, but the event is dispatched for Firefox. Asking the internet it looks like Firefox is in the right here: click() ultimately calls dispatchEvent (directly), dispatchEvent should go through even on disabled event. This was specifically fixed in Firefox[1], and there is an issue opened against Chrome[2] (cf also: spec discussion[3]). There's an other issue which mentions inconsistencies between the actual browser and WPT[4], but for us Chrome always 100% does the "wrong" thing. Anyway add a disabled flag in click, though I don't know that it's the right fix, and it may need to be added to other events as well? [0] https://github.com/odoo/odoo/blob/c89cdcf11c66e80c33cd77edceaee7eb59a704b3/addons/web/static/tests/fields/relational_fields/field_many2one_tests.js#L2044 [1] https://bugzilla.mozilla.org/show_bug.cgi?id=329509 [2] https://bugs.chromium.org/p/chromium/issues/detail?id=1115661 [3] whatwg/html#5805 (comment) [4] https://bugs.chromium.org/p/chromium/issues/detail?id=1116161
- Loading branch information