Center scroll lists when navigating with keyboard
- This applies to channel list and user list sidebars - This avoids having a selected item behind a sticky header - This provides better UX by starting the scroll before the bottom (or top) is reached, giving a preview of what comes next (or before)
This commit is contained in:
parent
b8db7a2f82
commit
77d70d6d91
@ -60,7 +60,7 @@ function hasRoleInChannel(channel, roles, nick) {
|
|||||||
function scrollIntoViewNicely(el) {
|
function scrollIntoViewNicely(el) {
|
||||||
// Ideally this would use behavior: "smooth", but that does not consistently work in e.g. Chrome
|
// Ideally this would use behavior: "smooth", but that does not consistently work in e.g. Chrome
|
||||||
// https://github.com/iamdustan/smoothscroll/issues/28#issuecomment-364061459
|
// https://github.com/iamdustan/smoothscroll/issues/28#issuecomment-364061459
|
||||||
el.scrollIntoView({block: "nearest", inline: "nearest"});
|
el.scrollIntoView({block: "center", inline: "nearest"});
|
||||||
}
|
}
|
||||||
|
|
||||||
function collapse() {
|
function collapse() {
|
||||||
|
Loading…
Reference in New Issue
Block a user