Open cmcleese opened 2 years ago
The cesium code stops/prevents the mousedown and touchstart events (with capture at document level) So clickOutside cannot receive neither the two events not a focus event on the canvas because by preventing the events cesium code also prevents the canvas getting focus
I created a codesandbox using quasar v1x with the exact same code and cesium version. With quasar v1x click events are handle correctly and dropdowns can close.
https://codesandbox.io/s/test-quasar-cesium-vue2-1nwu95
If for some reason the codesandbox doesn't start, just open a new terminal yarn start
, and refresh the mini browser.
This leads me to believe that perhaps along the way something changed in focus.js handlers between quasar versions. I will update my original post to include the test link for v1x quasar.
What happened?
Focusout doesn't always work for canvas elements. Quasar v2x
Something different happening with
src/utils/private/focusout.js
specifically with Chrome/Chromium. The focusin trigger event fires differently depending on which browser (chromium, FF) . This is when for example a menu or dropdown is to closed on click away.ex: https://codesandbox.io/s/test-quasar-cesium-vue3-edjxls You can see the document.activeElement via console.log output is different between browsers when trying to click away. I can't see what the difference would be other than the way focusout.js works.
This works however in quasar v1x : https://codesandbox.io/s/test-quasar-cesium-vue2-1nwu95
In chromium, focusin trigger() is called once clicking away from open dropdown. In firefox, it is not. Which allows the dropdown to close on click away as expected. The document.activeElement confirms this. In chromium, it still think the click away is happening on the same element and thus focusin fires the event again.
What did you expect to happen?
Focusout should trigger correctly when clicking away on anyway canvas element with the same behavior across all browsers.
Reproduction URL
Quasar v2x: https://codesandbox.io/s/test-quasar-cesium-vue3-edjxls?file=/src/index.template.html
Quasar v1x: https://codesandbox.io/s/test-quasar-cesium-vue2-1nwu95
How to reproduce?
document.activeElement
in Chrome & FirefoxFlavour
Quasar CLI (@quasar/cli | @quasar/app)
Areas
Components (quasar), Composables (quasar)
Platforms/Browsers
Firefox, Chrome, Microsoft Edge
Quasar info output
Relevant log output
No response
Additional context
No response