-
Notifications
You must be signed in to change notification settings - Fork 587
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
TextInput trailing action design and API update #2033
Conversation
🦋 Changeset detectedLatest commit: 9b9c963 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 📦
|
…r-action-design-update
The tooltip container seems to be positioned awkwardly here. You can hover and get the tooltip but you're not on the button yet so a click doesn't trigger the button. Kapture.2022-04-19.at.18.28.42.mp4
24x24, does this meet our minimum button size for a11y? How do we solve for this when it's limited by the container's size? |
Great catch! I'll fix that.
We increase the size of the clickable area for |
TIL! |
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.
Looking good overall! Left a few comments on tiny details.
Approving in advance :)
/** Text that appears in a tooltip. If an icon is passed, this is also used as the label used by assistive technologies. */ | ||
['aria-label']?: string | ||
/** The icon to render inside the button */ | ||
icon?: React.FunctionComponent<IconProps> | ||
/** | ||
* @deprecated Text input action buttons should only use the 'invisible' button variant |
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: Does this make it a breaking change? Would there be new warnings when someone upgrades primer/react?
How do we usually deprecate props?
Side note: Are there any users of TextInput.Action
? Can we get away with this in patch
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.
Does this make it a breaking change?
No, if they're still using variant
, it will still work
Would there be new warnings when someone upgrades primer/react?
I think it would just be in their IDE
How do we usually deprecate props?
I don't think we have a defined process yet. Maybe @colebemis knows
Side note: Are there any users of TextInput.Action? Can we get away with this in patch
I don't think so. Even if there were, I think we can get away with this in a patch.
src/Button/IconButton.tsx
Outdated
// when `size !== 'medium'`, vertical alignment of the icon is thrown off | ||
// because changing the font size draws an em-box that does not match the | ||
// bounding box of the SVG | ||
{fontSize: 1}, |
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.
Option: Should we move this to getSizeStyles
where fontSize is set?
Line 232 in 4fd9b74
if (iconOnly) { |
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.
Good call!
.changeset/tall-dancers-exercise.md
Outdated
- Inner action's hover bg should not touch the text input edges | ||
- Increases touch target area of the inner action button | ||
- Deprecation: we only want to allow inner action buttons to be icon buttons | ||
- Deprecation: we only want to allow inner action buttons to be the 'invisible' variant |
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.
Optional: Should we rephrase to look more like a change log?
"we only want to allow inner action buttons to be icon buttons" sounds a bit rude in a changelog 😅
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.
Well that's no good. Changing!
…primer/react into mp/textinput-inner-action-design-update
…r-action-design-update
Changes:
Screenshots
Before:
![innerAction-before](https://user-images.githubusercontent.com/2313998/164017779-b1efa149-3739-4087-bb59-9870add2c54c.gif)
After:
![innerAction-after](https://user-images.githubusercontent.com/2313998/164017805-69730821-8972-4252-83d9-159b88623939.gif)
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.