-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fix(TableToolbarSearch): allow default values to be set #5089
fix(TableToolbarSearch): allow default values to be set #5089
Conversation
Deploy preview for the-carbon-components ready! Built with commit abb08ec https://deploy-preview-5089--the-carbon-components.netlify.com |
Deploy preview for carbon-components-react failed. Built with commit abb08ec https://app.netlify.com/sites/carbon-components-react/deploys/5e2b627e74fb1f0008826468 |
Deploy preview for carbon-elements ready! Built with commit abb08ec |
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 jumping in @tw15egan!
1cd2e5d
to
baca15e
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.
LGTM! 🎉
…carbon-components into table-toolbar-search-value-fix
@joshblack updated |
@joshblack are we good with this? |
…carbon-components into table-toolbar-search-value-fix
Closes #3170
The
DefaultValue
prop was being ignored. This checks for the presence of aDefaultValue
, and if it exists, it is used as the default state ofvalue
. On the initial load, it sets the expanded state totrue
and runs theonChangeProp
to filter the table. Modified thehandleOnInputValueChange
inDataTable.js
to account for non-event based sorting (table loads with a default value).Changelog
New
DefaultValue
prop works as intendedChanged
handleOnInputValueChange
now has adefaultValue
parameterRemoved
DefaultValue
being passed directly down toSearch
. IfDefaultValue
exists, it is immediately set tovalue
which is then passed down.Testing / Reviewing
src/components/DataTable/stories/with-toolbar.js
defaultValue="1"
toTableToolbarSearch
With Toolbar
Storybook example, verify only 1 result shows up.