Skip to content

Commit

Permalink
[Autocomplete] Fix group labels hiding items during keybd navigation (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
aisamu authored and oliviertassinari committed Jan 20, 2020
1 parent 150f96e commit 0d56ff2
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,11 @@ export default function useAutocomplete(props) {
const elementBottom = element.offsetTop + element.offsetHeight;
if (elementBottom > scrollBottom) {
listboxNode.scrollTop = elementBottom - listboxNode.clientHeight;
} else if (element.offsetTop < listboxNode.scrollTop) {
listboxNode.scrollTop = element.offsetTop;
} else if (
element.offsetTop - element.offsetHeight * (groupBy ? 1.3 : 0) <
listboxNode.scrollTop
) {
listboxNode.scrollTop = element.offsetTop - element.offsetHeight * (groupBy ? 1.3 : 0);
}
}
}
Expand Down

0 comments on commit 0d56ff2

Please sign in to comment.