Skip to content

Commit

Permalink
fix(player): do not prevent f1-f12 keys from working
Browse files Browse the repository at this point in the history
closes #1148
  • Loading branch information
mihar-22 committed Feb 6, 2024
1 parent d243793 commit 6a06b57
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ export class SliderEventsController extends ViewController<
newValue = min();
} else if (key === 'End' || key === 'PageDown') {
newValue = max();
} else if (!event.metaKey && /[0-9]/.test(key)) {
} else if (!event.metaKey && /^[0-9]$/.test(key)) {
newValue = ((max() - min()) / 10) * Number(key);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/vidstack/src/core/keyboard/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export class MediaKeyboardController extends MediaPlayerController {
}

let { method, value } = this._getMatchingMethod(event),
isNumberPress = !event.metaKey && /[0-9]/.test(event.key);
isNumberPress = !event.metaKey && /^[0-9]$/.test(event.key);

if (!isString(value) && !isArray(value) && !isNumberPress) {
value?.callback(event);
Expand Down

0 comments on commit 6a06b57

Please sign in to comment.