-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(keyboard-key): add documentation #4164
base: main
Are you sure you want to change the base?
Conversation
…to docs/keyboard-key-init
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 6bb47b8. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
Size Change: +11 B (0%) Total Size: 1.1 MB
ℹ️ View Unchanged
|
Paste Run #9085
Run Properties:
|
Project |
Paste
|
Branch Review |
docs/keyboard-key-init
|
Run status |
Passed #9085
|
Run duration | 02m 20s |
Commit |
6bb47b8ea7: docs(keyboard-key): address PR comments
|
Committer | Kristian Antrobus |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
0
|
Pending |
0
|
Skipped |
0
|
Passing |
67
|
View all changes introduced in this branch ↗︎ |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 63ce93d:
|
const keyCombinationState = useKeyCombination({ | ||
keys: [platformTriggerKey, "k"], | ||
onCombinationPress: onOpen, | ||
enablePressStyles: true, |
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.
question: do you think we should disable press styles when !isOpen ?
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.
enablePressStyles doesn't trigger the press styles but enables them when the key is pressed. The logic is handled by component and hook but will only show them if this is set to true. By default press styles are not shown which was the desired functionality.
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.
when the search modal is open, it feels a little funny to have the press styles enabled in the background. since you're typing into the search input and could use a "k" and see the press styles going in and out in the background. tiny nit, just thought I'd mention!
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.
the open state is stored in the same file so I can disable it when the modal it open (which it should do anyway).
packages/paste-website/src/components/site-wrapper/site-header/SiteHeaderSearch.tsx
Show resolved
Hide resolved
packages/paste-website/src/component-examples/KeyboardKeyExamples.ts
Outdated
Show resolved
Hide resolved
<KeyboardKeyGroup disabled> | ||
<KeyboardKey>S</KeyboardKey> | ||
</KeyboardKeyGroup> | ||
<Paragraph>Open the Menu for the disabled Keyboard Key in context:</Paragraph> |
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.
suggestion: I don't think this text is necessary
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.
This was in the examples from the spec by Sarah.Happy to discuss removing
</Box> | ||
|
||
From [W3C's guide to developing a keyboard interface](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#keyassignmentconventionsforcommonfunctions): | ||
The following keyboard commands should be used in any context where the actions are appropriate. |
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.
suggestion: can you clarify this wording a bit? it's a little confusing what you're recommending
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.
I think Sarah was trying to say that the following list of keyboard shortcuts can be used where the associated action is appropriate. So command+x can be used but only as a cut action. The paragraph below this puts it into context.
packages/paste-website/src/pages/components/keyboard-key/index.mdx
Outdated
Show resolved
Hide resolved
Co-authored-by: Nora Krantz <[email protected]>
… into docs/keyboard-key-init
Co-authored-by: Nora Krantz <[email protected]>
… into docs/keyboard-key-init
All else looks great!!! |
Added documentation from the spec.
https://paste-docs-git-docs-keyboard-key-init-twilio.vercel.app/components/keyboard-key