You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(core): add internal key binding service - #17789
Adds an internal IgxKeyBindingsService, an Angular version of the addKeybindings controller from Ignite UI for Web Components, and moves the expansion panel header, date picker, date range picker, time picker and splitter bar to it.
Motivation / Context
The library has no shared keyboard layer. Each component mixes keydown.<key> host listeners, switch (event.key) handlers and PlatformUtil.KEYMAP checks. Each one also handles preventDefault, key repeats and keys from inner inputs in its own way, and some still check old IE key names. The service gives one declarative keyboard map per component, with the same defaults as Web Components.
The issue proposed a host directive. The PR uses a service that the component lists in its providers, so a component's keyboard map is registered in one place, in its constructor.
Ported components keep their existing behavior. The exceptions are deliberate fixes, all listed in the CHANGELOG.
Type of Change (check all that apply):
Bug fix
New functionality
Breaking change (fix or feature that would cause existing functionality to not work as expected)
Refactoring (no functional changes)
Documentation
Demos
CI/CD
Tests
Changelog
Skills/Agents
Component(s) / Area(s) Affected:
How Has This Been Tested?
Unit tests
Manual testing
Automated e2e tests
Test Configuration:
Angular version:
Browser(s):
OS:
Screenshots / Recordings
Checklist:
All relevant tags have been applied to this PR
This PR includes unit tests covering all the new code (test guidelines)
This PR includes API docs for newly added methods/properties (api docs guidelines)
This PR includes feature/README.MD updates for the feature docs
This PR includes general feature table updates in the root README.MD
This PR includes CHANGELOG.MD updates for newly added functionality
This PR contains breaking changes
This PR includes ng update migrations for the breaking changes (migrations guidelines)
This PR includes behavioral changes and the feature specification has been updated with them
Accessibility (ARIA, keyboard navigation, focus management) has been verified
- Release the held keys when focus leaves the host. A key released
outside it, for example in an overlay, no longer stays held and
matches a later combination, such as Alt alone opening a picker.
- An ignored repeated keydown still gets preventDefault and
stopPropagation; only the handler is skipped, so a held key keeps
its default action prevented.
Replace the Enter, Space and Alt + Arrow Up/Down host listeners with
IgxKeyBindingsService and drop the IE-only Spacebar key. Alt + Arrow
Up/Down no longer expand or collapse a disabled header.
Replace the keydown host listener with IgxKeyBindingsService. The keys
come from the inner inputs, so none are skipped. Alt + Arrow Up/Down
now prevent their default browser action.
Replace the keydown host listeners of the date picker and the calendar
container with IgxKeyBindingsService. Alt + Arrow Up/Down now prevent
their default browser action. The calendar container still stops
Alt + Arrow Up, so the picker does not close twice.
Replace the keydown host listeners of the time picker and its item
lists with IgxKeyBindingsService. Alt + Arrow Up/Down now prevent their
default browser action in drop-down mode and keep it in dialog mode.
Escape keeps its default action. Held arrows keep moving through the
items.
Remove the splitter bar from the tab order only when it can neither
resize nor collapse its panes, so a pane collapsed with Ctrl + arrow
can be expanded again from the keyboard. Ctrl + arrow no longer
collapses a pane when nonCollapsible is set. Add a resizable toggle to
the splitter sample.
Tracking releases by event.key leaves shifted symbols stuck when Shift is released first. With a [shiftKey, '!'] binding on a US layout, press Shift+1, release Shift, then release 1: the last keyup reports 1, so deleting it leaves ! in _pressedKeys. Pressing Shift alone then invokes the shortcut without 1 being held. Record the keydown name by physical key identity (event.code) and release that stored name in both keyup paths, preserving support for events without a code. Add a regression test for this release order.
Avoid preventing default for canceled Alt-arrow interactions
These Alt-arrow bindings still prevent the default before openPanel/closePanel checks interaction.cancel. A projected native select whose panel interaction is canceled therefore loses its native Alt+ArrowDown popup behavior; previously these handlers did not prevent the event. Disable automatic prevention here, as for Enter/Space, and cover canceled Alt-arrow interactions.
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
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.
Closes #17753
Description
Adds an internal
IgxKeyBindingsService, an Angular version of theaddKeybindingscontroller from Ignite UI for Web Components, and moves the expansion panel header, date picker, date range picker, time picker and splitter bar to it.Motivation / Context
The library has no shared keyboard layer. Each component mixes
keydown.<key>host listeners,switch (event.key)handlers andPlatformUtil.KEYMAPchecks. Each one also handlespreventDefault, key repeats and keys from inner inputs in its own way, and some still check old IE key names. The service gives one declarative keyboard map per component, with the same defaults as Web Components.The issue proposed a host directive. The PR uses a service that the component lists in its
providers, so a component's keyboard map is registered in one place, in its constructor.Ported components keep their existing behavior. The exceptions are deliberate fixes, all listed in the CHANGELOG.
Type of Change (check all that apply):
Component(s) / Area(s) Affected:
How Has This Been Tested?
Test Configuration:
Screenshots / Recordings
Checklist:
feature/README.MDupdates for the feature docsREADME.MDCHANGELOG.MDupdates for newly added functionalityng updatemigrations for the breaking changes (migrations guidelines)