Skip to content

Commit

Permalink
Fix nested listbox selection behavior (#851)
Browse files Browse the repository at this point in the history
* Fix nested listbox selection behavior

* Implement review feedback
  • Loading branch information
henryB99 authored Jan 25, 2024
1 parent 3f29115 commit 6aa2c1e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ class Listbox<T, C : HTMLElement>(tag: Tag<C>, id: String?) : Tag<C> by tag, Ope

value.handler?.invoke(
this,
mousedowns.mapNotNull { e ->
clicks.mapNotNull { e ->
e.preventDefault()
e.stopImmediatePropagation()
entries.current[index].let {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ abstract class OpenClose: WithJob {
return if (domNode is HTMLButtonElement) {
clicks
} else {
keydowns.filter { shortcutOf(it) in listOf(Keys.Space, Keys.Enter) }
merge(clicks, keydowns.filter { shortcutOf(it) in setOf(Keys.Space, Keys.Enter) })
}
}
}

0 comments on commit 6aa2c1e

Please sign in to comment.