Update the card perma to support bridge buttonsa and the edit form state

This commit is contained in:
Jay Ohms
2026-01-09 13:09:51 -05:00
parent 9ac34f8882
commit b074a11e1d
5 changed files with 31 additions and 5 deletions
@@ -5,10 +5,16 @@ export default class extends BridgeComponent {
static component = "buttons"
static targets = [ "button" ]
buttonTargetConnected(element) {
buttonTargetConnected() {
this.notifyBridgeOfConnect()
}
buttonTargetDisconnected() {
if (!this.#isControllerTearingDown()) {
this.notifyBridgeOfConnect()
}
}
notifyBridgeOfConnect() {
const buttons = this.#enabledButtonTargets
.map((target, index) => {
@@ -30,4 +36,8 @@ export default class extends BridgeComponent {
return this.buttonTargets
.filter(target => !target.closest("[data-bridge-disabled]"))
}
#isControllerTearingDown() {
return !document.body.contains(this.element)
}
}