fixup 362d9444: autoscroll manage page only during incremental search
This commit is contained in:
parent
6f0dd5e9b6
commit
a61ee5f093
|
@ -89,7 +89,7 @@ function onDOMready() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function scrollElementIntoView(element, {invalidMarginRatio = .25} = {}) {
|
function scrollElementIntoView(element, {invalidMarginRatio = 0} = {}) {
|
||||||
// align to the top/bottom of the visible area if wasn't visible
|
// align to the top/bottom of the visible area if wasn't visible
|
||||||
const {top, height} = element.getBoundingClientRect();
|
const {top, height} = element.getBoundingClientRect();
|
||||||
const {top: parentTop, bottom: parentBottom} = element.parentNode.getBoundingClientRect();
|
const {top: parentTop, bottom: parentBottom} = element.parentNode.getBoundingClientRect();
|
||||||
|
|
|
@ -64,7 +64,7 @@ onDOMready().then(() => {
|
||||||
focusedEntry = found;
|
focusedEntry = found;
|
||||||
focusedLink = $('.style-name-link', found);
|
focusedLink = $('.style-name-link', found);
|
||||||
focusedName = found.styleNameLowerCase;
|
focusedName = found.styleNameLowerCase;
|
||||||
scrollElementIntoView(found);
|
scrollElementIntoView(found, {invalidMarginRatio: .25});
|
||||||
animateElement(found, {className: 'highlight-quick'});
|
animateElement(found, {className: 'highlight-quick'});
|
||||||
resizeTo(focusedLink);
|
resizeTo(focusedLink);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -406,7 +406,7 @@ function handleUpdate(style, {reason, method} = {}) {
|
||||||
filterAndAppend({entry});
|
filterAndAppend({entry});
|
||||||
if (!entry.matches('.hidden') && reason !== 'import') {
|
if (!entry.matches('.hidden') && reason !== 'import') {
|
||||||
animateElement(entry);
|
animateElement(entry);
|
||||||
scrollElementIntoView(entry, {invalidMarginRatio: 0});
|
scrollElementIntoView(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleToggledOrCodeOnly() {
|
function handleToggledOrCodeOnly() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user