Skip to content

Instantly share code, notes, and snippets.

@jason-woolf
Last active May 30, 2021 15:58
Show Gist options
  • Save jason-woolf/06a8ab893b0bac9f6203feae8191f529 to your computer and use it in GitHub Desktop.
Save jason-woolf/06a8ab893b0bac9f6203feae8191f529 to your computer and use it in GitHub Desktop.
Suppress automatic scrolling in Desmos expression list
...
Calc = window.Calc;
// Squelch the automatic scroll-into-view behavior for programs
Calc.controller.origScrollItemIntoView = Calc.controller.scrollItemIntoView;
Calc.controller.origScrollSelectedItemIntoView = Calc.controller.scrollSelectedItemIntoView;
Calc.controller.scrollSelectedItemIntoView = function () {
const expr = this.getSelectedItem();
if (expr && expr.text && isAProgram(expr.text)) {
// No auto scrolling for a program!
return;
}
Calc.controller.origScrollSelectedItemIntoView();
}
Calc.controller.scrollItemIntoView = function (expr) {
if (expr && expr.text && isAProgram(expr.text)) {
// No auto scrolling for a program!
return;
}
Calc.controller.origScrollItemIntoView(expr);
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment