diff --git a/README.md b/README.md index 970de71f..bb4e0b74 100644 --- a/README.md +++ b/README.md @@ -363,7 +363,10 @@ Adds `aria-labelledby` to search input when input starts with `#`, adds `aria-la Type: `bool` (default: `false`) -Adds navigation with arrow keys, page down/up and toggle of selection with enter. Arrow/page up/down also toggles open of dropdown if closed. +Adds navigation with `arrow` keys, `page down/up` / `home/end` and toggle of selection with `enter`. `Arrow/page up/down` also toggles open of dropdown if closed. + +To close open dropdown `escape` or `tab` can be used and `backspace` can be used for deletion of tags on empty search input. + ## Styling and Customization diff --git a/src/tree/index.js b/src/tree/index.js index 9aa0f8d9..80f84fa6 100644 --- a/src/tree/index.js +++ b/src/tree/index.js @@ -54,7 +54,9 @@ class Tree extends Component { () => { const { activeDescendant } = nextProps const activeLi = activeDescendant && document && document.getElementById(activeDescendant) - if (activeLi) { activeLi.scrollIntoView(false) } + if (activeLi) { + activeLi.scrollIntoView({ block: 'center' }) + } } ) } @@ -107,7 +109,7 @@ class Tree extends Component { return items } - hasMore = () => this.currentPage <= this.totalPages + hasMore = () => this.currentPage < this.totalPages loadMore = () => { this.currentPage = this.currentPage + 1