-
Notifications
You must be signed in to change notification settings - Fork 535
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
TextInputWithTokens - adds the ability to hide text input tokens after a certain number #1523
Conversation
🦋 Changeset detectedLatest commit: 73a3caf The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
size-limit report 📦
|
The snapshots that are failing in this branch are also failing on |
@@ -172,6 +210,16 @@ function TextInputWithTokensInnerComponent<TokenComponentType extends AnyReactCo | |||
} | |||
} | |||
|
|||
const focusInput: MouseEventHandler = () => { | |||
combinedInputRef.current?.focus() |
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.
Why is this 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 makes sure the actual <input />
gets focus no matter where in the in the input wrapper the user clicks (except for clicking on tokens)
@@ -29,6 +29,18 @@ const LabelledTextInputWithTokens: React.FC<TextInputWithTokensProps> = ({onToke | |||
</> | |||
) | |||
|
|||
// describe('axe test', () => { |
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.
Are you planning to uncomment 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.
Oops - yes!
for (const tokenLabel of allTokenLabels) { | ||
const tokenNode = getByText(tokenLabel) | ||
expect(tokenNode).toBeDefined() | ||
} |
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.
Thank you for always writing such thorough tests ❤️
51aeb44
to
8565a51
Compare
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.
💖
Co-authored-by: Cole Bemis <colebemis@github.com>
Screenshots
Screen.Recording.10-19-2021.at.2.27.PM.mp4
Merge checklist
Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.