Bug 1549987 - Improve scrolling feel for quick open r=jlast

Removes the smoothscrolling for QuickOpen

Differential Revision: https://phabricator.services.mozilla.com/D30420

--HG--
extra : moz-landing-system : lando
This commit is contained in:
David Walsh 2019-05-10 15:08:40 +00:00
parent fd514440a1
commit e8f079b017
2 changed files with 3 additions and 18 deletions

View File

@ -115,11 +115,7 @@ export class QuickOpenModal extends Component<Props, State> {
const queryChanged = prevProps.query !== this.props.query;
if (this.refs.resultList && this.refs.resultList.refs) {
scrollList(
this.refs.resultList.refs,
this.state.selectedIndex,
nowEnabled || !queryChanged
);
scrollList(this.refs.resultList.refs, this.state.selectedIndex);
}
if (nowEnabled || queryChanged) {

View File

@ -5,13 +5,8 @@
// @flow
import { isFirefox } from "devtools-environment";
import { transitionTimeout } from "../components/shared/Modal";
export function scrollList(
resultList: Element[],
index: number,
delayed: boolean = false
): void {
export function scrollList(resultList: Element[], index: number): void {
if (!resultList.hasOwnProperty(index)) {
return;
}
@ -20,18 +15,12 @@ export function scrollList(
const scroll = () => {
if (isFirefox()) {
resultEl.scrollIntoView({ block: "center", behavior: "smooth" });
resultEl.scrollIntoView({ block: "nearest", behavior: "auto" });
} else {
chromeScrollList(resultEl, index);
}
};
if (delayed) {
// Wait for Modal Transition timeout before scrolling to resultEl.
setTimeout(scroll, transitionTimeout + 10);
return;
}
scroll();
}