Skip to content

Commit

Permalink
feat: dispatch custom event on focus change
Browse files Browse the repository at this point in the history
  • Loading branch information
fidelthomet committed Feb 10, 2025
1 parent 2abec58 commit eb2d647
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,15 @@ class VantageRenderer extends HTMLElement {
p.element.setAttribute('focus', p === candidate)
})
candidate.element.setAttribute('focus', true)

this.dispatchEvent(
new CustomEvent('vantage:set-focus', {
bubbles: true,
detail: {
id: candidate.id
}
})
)
}
}

Expand Down

0 comments on commit eb2d647

Please sign in to comment.