Skip to content

Commit

Permalink
Updates to menu and popover
Browse files Browse the repository at this point in the history
  • Loading branch information
lazaronixon committed Oct 13, 2024
1 parent 341aada commit 1942bda
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { Controller } from "@hotwired/stimulus"
import { nextFrame } from "helpers/timing_helpers"

export default class extends Controller {
static targets = [ "item" ]
static values = { index: Number }

indexValueChanged() {
this.#removeTabstops()
this.#focusSelectedItem()
this.#focusCurrentItem()
}

prev() {
Expand All @@ -26,7 +25,7 @@ export default class extends Controller {
this.itemTargets.forEach(item => item.tabIndex = -1)
}

#focusSelectedItem() {
#focusCurrentItem() {
this.itemTargets[this.indexValue].tabIndex = 0
this.itemTargets[this.indexValue].focus()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,10 @@ export default class extends Controller {

#closeTimer

connect() {
this.#updateExpanded()
}

show() {
this.#resetTimer()
this.menuTarget.show()
this.#updateExpanded()
this.#resetTimer()
this.#orient()
}

Expand Down

0 comments on commit 1942bda

Please sign in to comment.