Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…dropdown-tree-select into developTemp
  • Loading branch information
Magnus Ellinge committed Apr 2, 2019
2 parents 2cbf660 + e1bb15b commit 4b3ebcf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion README.md
Expand Up @@ -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

Expand Down
6 changes: 4 additions & 2 deletions src/tree/index.js
Expand Up @@ -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' })
}
}
)
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4b3ebcf

Please sign in to comment.