PR feedback

This commit is contained in:
Jay Ohms
2026-02-26 07:53:02 -05:00
parent 84c650ab25
commit 7427675fc8
4 changed files with 10 additions and 1 deletions
@@ -7,6 +7,8 @@ export default class extends BridgeComponent {
static values = { submitTitle: String }
connect() {
super.connect()
if (!this.beforeUnloadHandler) {
this.beforeUnloadHandler = this.handleBeforeUnload.bind(this)
}
@@ -15,6 +17,8 @@ export default class extends BridgeComponent {
}
disconnect() {
super.disconnect()
if (this.beforeUnloadHandler) {
window.removeEventListener("beforeunload", this.beforeUnloadHandler)
}