Tweak orientation helper to prevent popups from going off screen

This commit is contained in:
Adrien Maston
2026-01-23 14:06:17 +01:00
parent 65b2db0ec8
commit 764eb8987a
5 changed files with 29 additions and 23 deletions
@@ -26,7 +26,7 @@ export default class extends Controller {
this.dialogTarget.showModal()
} else {
this.dialogTarget.show()
orient(this.dialogTarget)
orient({ target: this.dialogTarget, anchor: this.element })
}
this.loadLazyFrames()
@@ -46,7 +46,7 @@ export default class extends Controller {
this.dialogTarget.close()
this.dialogTarget.setAttribute("aria-hidden", "true")
this.dialogTarget.blur()
orient(this.dialogTarget, false)
orient({ target: this.dialogTarget, reset: true })
this.dispatch("close")
}