Skip to content

Commit

Permalink
check if options set
Browse files Browse the repository at this point in the history
  • Loading branch information
nuxodin committed Jul 16, 2021
1 parent b3bd99a commit ac1134e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion monkeyPatches/focusOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
if (!supported) {
let original = HTMLElement.prototype.focus;
Element.prototype.focus = HTMLElement.prototype.focus = function(options){
if (options.preventScroll) {
if (options && options.preventScroll) {
const map = new Map();
let p = this;
while (p = p.parentNode) map.set(p, [p.scrollLeft, p.scrollTop]);
Expand Down

0 comments on commit ac1134e

Please sign in to comment.