Skip to content

Commit

Permalink
Timeline: preventDefault() and stopPropagation during keyboard naviga…
Browse files Browse the repository at this point in the history
…tion

  due to unwanted side effects, like marked text by cursor.
  • Loading branch information
Ivo Sonderegger committed Mar 1, 2021
1 parent a06e504 commit 1333577
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/meteoJS/Timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -775,14 +775,20 @@ export class Timeline {
const matches = time.match(/^([0-9]+)\s*([a-zA-Z]+)$/);
if (matches === null)
return;
if (_isEventMatchPressedKeys(event, this._keyboardNavigation[method][time]))
if (_isEventMatchPressedKeys(event, this._keyboardNavigation[method][time])) {
this[method](+matches[1], matches[2]);
event.preventDefault();
event.stopPropagation();
}
});
}
else
if (method in this &&
_isEventMatchPressedKeys(event, this._keyboardNavigation[method]))
_isEventMatchPressedKeys(event, this._keyboardNavigation[method])) {
this[method]();
event.preventDefault();
event.stopPropagation();
}
});
});
}
Expand Down

0 comments on commit 1333577

Please sign in to comment.