Skip to content

Commit

Permalink
Remove unnessasary callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
splashdust committed Dec 20, 2024
1 parent 7026576 commit 93fe981
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions libs/core/src/primitives/field-base/field-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,6 @@ export class GdsFieldBase extends GdsElement {
super()
}

connectedCallback(): void {
super.connectedCallback()
this._mainSlotElement.addEventListener(
'slotchange',
this.#handleSlotChange.bind(this, 'main'),
)
}

disconnectedCallback() {
super.disconnectedCallback()
this._mainSlotElement.removeEventListener(
'slotchange',
this.#handleSlotChange.bind(this, 'main'),
)
}

render() {
const CLASSES = {
field: true,
Expand Down Expand Up @@ -134,10 +118,10 @@ export class GdsFieldBase extends GdsElement {
`
}

#handleSlotChange(
#handleSlotChange = (
slotName: 'lead' | 'trail' | 'action' | 'main',
event: Event,
) {
) => {
const slot = event.target as HTMLSlotElement
const assignedNodes = slot.assignedNodes({ flatten: true })
const slotOccupied =
Expand Down

0 comments on commit 93fe981

Please sign in to comment.