Fix intermittent bug

Dunno why, but this recently started occuring for me in dev and test. Browser update?
This commit is contained in:
David Cook
2024-04-04 13:42:33 +11:00
committed by Filipe
parent 15790d3d8e
commit 97d13597b0

View File

@@ -73,7 +73,9 @@ export default class PopoutController extends Controller {
}
closeIfOutside(e) {
if (!this.dialogTarget.contains(e.target)) {
// Note that we need to ignore the clicked button. Even though the listener was only just
// registered, it still fires sometimes for some unkown reason.
if (!this.dialogTarget.contains(e.target) && !this.buttonTarget.contains(e.target)) {
this.close();
}
}