feat: add NumpadEnter support for BTable and BFormTags keyboard navigation (accessibility) #2884
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
Fixes an accessibility issue where BTable header sorting and row selection, as well as BFormTags tag addition, were not responding to the NumpadEnter key press. Users who prefer or rely on the numeric keypad for navigation could not interact with these components using the Enter key on the numpad.
Changes
Components Updated
BTableLite.vue
handleHeaderKeydownto recognizeNumpadEnterin addition toEnterfor sortable header navigationhandleRowKeydownto recognizeNumpadEnterin addition toEnterfor row selection and interactionBFormTags.vue
onKeydownto recognizeNumpadEnterviae.codecheck as a fallback alongside the existinge.key === 'Enter'checkTesting
Added comprehensive test coverage in
table-keyboard.spec.ts:All 1637 existing tests continue to pass, plus 4 new tests specifically for NumpadEnter support.
Technical Details
The implementation uses the
codeproperty of KeyboardEvent to detectNumpadEnter, which is the standardized way to distinguish between the main Enter key (code: 'Enter') and the numpad Enter key (code: 'NumpadEnter'). Both keys reportkey: 'Enter', but have differentcodevalues.Impact
Closes #[issue_number]
Original prompt
Fixes #2876
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.