Closed jmeurice closed 1 month ago
There is an edge case in the Search component:
expandable=true
Screenshot:
This is due to the fact that the visibility of the clear button is decided by value === '':
value === ''
https://github.com/carbon-design-system/carbon-components-svelte/blob/ba27830b2f6ad1fb2c8cc7dc1a8c833cf9e236d0/src/Search/Search.svelte#L162-L162
However the search is collapsed when the trimmed value is empty:
https://github.com/carbon-design-system/carbon-components-svelte/blob/ba27830b2f6ad1fb2c8cc7dc1a8c833cf9e236d0/src/Search/Search.svelte#L142-L146
Possible fixes:
expanded
The first version sounds the most consistent with API to me. Users can choose to clear the value if its empty on blur manually.
I can do a PR if this sounds good.
Yes – PRs always welcome.
There is an edge case in the Search component:
expandable=true
Screenshot:
This is due to the fact that the visibility of the clear button is decided by
value === ''
:https://github.com/carbon-design-system/carbon-components-svelte/blob/ba27830b2f6ad1fb2c8cc7dc1a8c833cf9e236d0/src/Search/Search.svelte#L162-L162
However the search is collapsed when the trimmed value is empty:
https://github.com/carbon-design-system/carbon-components-svelte/blob/ba27830b2f6ad1fb2c8cc7dc1a8c833cf9e236d0/src/Search/Search.svelte#L142-L146
Possible fixes:
expanded
is false. Again this might hide the search when the contained value is whitespace.The first version sounds the most consistent with API to me. Users can choose to clear the value if its empty on blur manually.
I can do a PR if this sounds good.