-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix: add keyboard handlers to sp-table-cell-head #4473
Conversation
Lighthouse scores
What is this?Lighthouse scores comparing the documentation site built from the PR ("Branch") to that of the production documentation site ("Latest") and the build currently on Transfer Size
Request Count
|
Tachometer resultsChrometable permalinkbasic-test
Firefoxtable permalinkbasic-test
|
packages/table/src/TableHeadCell.ts
Outdated
protected handleKeyup(event: KeyboardEvent): void { | ||
const { code } = event; | ||
switch (code) { | ||
case 'Space': | ||
this.removeEventListener('keyup', this.handleKeyup); | ||
this.click(); | ||
break; | ||
/* c8 ignore next 2 */ | ||
default: | ||
break; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you ever get a keyup
on Space
that didn't previously have a keydown
on Space
? In that case that you can't, which is how I understand this to work, could we simplify and have keyup
be the persistent listener and not require the keydown
listener at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
honestly I copied this from swatch which was doing the same thing. Happy to simplify if that makes sense - I just assumed there was a good reason for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small addition needs to go in to the definition of this class. Can you make sure it is added before we can land this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Description
Adds keyboard handlers to sp-table-cell-head
Related issue(s)
#4472
Motivation and context
Keyboard handlers needed for accessibility.
How has this been tested?
Screenshots (if appropriate)
Types of changes
Checklist
Best practices
This repository uses conventional commit syntax for each commit message; note that the GitHub UI does not use this by default so be cautious when accepting suggested changes. Avoid the "Update branch" button on the pull request and opt instead for rebasing your branch against
main
.