Skip to content
Snippets Groups Projects
Commit 2338f941 authored by Bruno Boi's avatar Bruno Boi
Browse files

[FIX] web: traceback in usePosition on Firefox

It turns out `instanceof` is wonky in Firefox when multiple
documents are involved (e.g. iframe) since [1] has been fixed
and [2] has not yet been addressed accordingly.
Because of that, the check at [3] will return false and
therefore `getReference` will be a Node rather than a Function,
thus triggering the traceback.

**Solution**
Check if `reference` is typeof 'function' instead, which will not fall into the Firefox trap.

[1]: https://bugzilla.mozilla.org/show_bug.cgi?id=1360715
[2]: https://bugzilla.mozilla.org/show_bug.cgi?id=1821790
[3]: https://github.com/odoo/odoo/pull/73130/commits/a9614e0babd6dc517287d547708a8be758c14e12#diff-86a5774240db76cdc93cb570596564cc6816ef4144a7c960f10cd347b7564e44R220



opw-3348172

closes odoo/odoo#125380

X-original-commit: 4ac33b76
Signed-off-by: default avatarDavid Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: default avatarBruno Boi (boi) <boi@odoo.com>
parent cbd720c3
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment