From 1333577d532dfb0127d9238fd179dc3800995e4c Mon Sep 17 00:00:00 2001 From: Ivo Sonderegger Date: Mon, 1 Mar 2021 14:44:53 +0100 Subject: [PATCH] Timeline: preventDefault() and stopPropagation during keyboard navigation due to unwanted side effects, like marked text by cursor. --- src/meteoJS/Timeline.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/meteoJS/Timeline.js b/src/meteoJS/Timeline.js index 416bd804..2d8a409c 100644 --- a/src/meteoJS/Timeline.js +++ b/src/meteoJS/Timeline.js @@ -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(); + } }); }); }