refactor: Simplified key bindings controller#2167
Merged
rkaraivanov merged 3 commits intomasterfrom Mar 30, 2026
Merged
Conversation
- Dropped the `keydownRepeat` option in favor of a single `repeat` option that applies to all key events. - Removed some helper functions and simplified the `parseKeys` function to use a single pass. - Updated the affected components to use the new `repeat` option.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the shared key bindings controller API by removing the keydownRepeat trigger and introducing a single repeat option, then updates affected components/controllers to use the new option.
Changes:
- Replace
keydownRepeatwithrepeatin the key bindings controller options and update matching logic. - Simplify
parseKeys()to a single-pass implementation usingpartition(). - Update keybinding defaults in components/controllers that previously relied on
keydownRepeat.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/components/select/select.ts | Updates select keybinding defaults to use repeat: true. |
| src/components/radio/radio.ts | Updates radio keybinding defaults to use repeat: true. |
| src/components/dropdown/dropdown.ts | Updates dropdown keybinding defaults to use repeat: true. |
| src/components/date-time-input/date-time-input.ts | Updates date-time-input keybinding defaults to use repeat: true. |
| src/components/common/util.ts | Adds documentation for asArray() and partition(). |
| src/components/common/controllers/key-bindings.ts | Refactors keybinding triggers/repeat behavior and simplifies key parsing. |
| src/components/combo/controllers/navigation.ts | Updates combo navigation binding defaults to use repeat: true. |
| src/components/calendar/calendar.ts | Updates calendar keybinding defaults to use repeat: true. |
… logic in KeyBindingsController
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
keydownRepeatoption in favor of a singlerepeatoption that applies to all key events.parseKeysfunction to use a single pass.repeatoption.Type of Change
Checklist