Skip to content

Commit

Permalink
use block nearest when scrolling into view
Browse files Browse the repository at this point in the history
  • Loading branch information
maxmarcon committed Oct 19, 2023
1 parent 28acac6 commit f90f94c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
* ArrowUp when there is no active option navigates to the last option
* arrowUp when there is no active option navigates to the last option
* scroll options into view when they become active

## 1.2.1 (2023-10-17)

Expand Down
2 changes: 1 addition & 1 deletion assets/js/live_select.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default {
if (this.el.id === id) {
const option = this.el.querySelector(`div[data-idx="${idx}"]`)
if (option) {
option.scrollIntoView(false)
option.scrollIntoView({block: "nearest"})
}
}
})
Expand Down
2 changes: 1 addition & 1 deletion priv/static/live_select.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f90f94c

Please sign in to comment.