-
Notifications
You must be signed in to change notification settings - Fork 5k
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
TextField
component updates
#16424
TextField
component updates
#16424
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
TextField
component updates
879b035
to
bcce884
Compare
/** | ||
* The props to pass to the icon inside of the close button | ||
*/ | ||
clearButtonIconProps: PropTypes.shape(Icon.PropTypes), |
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.
Removing clearButtonIconProps
because this doesn't exist now that we are using ButtonIcon
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.
Just a small nit for tests
6b9d3bc
to
f3cb2c9
Compare
f3cb2c9
to
7153092
Compare
Builds ready [5cf8830]
Page Load Metrics (2429 ± 163 ms)
Bundle size diffs
highlights: |
5cf8830
to
7357dff
Compare
expect(onClear).toHaveBeenCalledTimes(1); | ||
expect(onClick).toHaveBeenCalledTimes(1); | ||
await user.click(getByRole('button', { name: /Clear/u })); | ||
expect(fn).toHaveBeenCalledTimes(1); | ||
}); | ||
it('should be able to accept inputProps', () => { | ||
const { getByRole } = render( |
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.
7357dff
to
938e5b5
Compare
Builds ready [938e5b5]
Page Load Metrics (2627 ± 175 ms)
Bundle size diffs
highlights: |
Explanation
What is the current state of things and why does it need to change?
The current
TextField
component handles the clear button logic but this was actually breaking the component whenvalue
was changed outside of theonChange
function. It also limits the flexibility of the component.What is the solution your changes offer and how does it work?
showClear
prop toshowClearButton
which is more specificScreenshots/Screencaps
Before
text.field.before.mov
After
text.field.after.mov
Manual Testing Steps
TextField
in the search bar (make sure it's under the Component Library section)For unit tests
yarn test:unit:jest ui/components/component-library/text-field/text-field.test.js
Pre-merge author checklist
Pre-merge reviewer checklist
If further QA is required (e.g. new feature, complex testing steps, large refactor), add the
Extension QA Board
label.In this case, a QA Engineer approval will be be required.