digdir / designsystemet

Designsystemet
https://designsystemet.no
MIT License
73 stars 35 forks source link

Combobox - Clear selected input #2022

Closed TobiasHansen closed 5 days ago

TobiasHansen commented 3 months ago

Description

The clearing option is disabled if the Combobox is not being used as multiple. We have a form where we need our users to being able to clear a selected value, current workaround is to have a clear button beside the Combobox, but I would like the UI to be consistent between all Comboboxes used in the form.

I see that different design systems does this does this differently, some allows it (like Aksel ), and some doesnt.

My proposal is to make it possible to clear the value, but if that is not desirable then I would like to be able to send in a custom InputField to extend the component ourself.

Additional Information

No response

mimarz commented 2 months ago

Thanks for requesting this feature!

Things have been abit busy, but we'll have a look at this.

First of we are thinking of testing this with always having the clear buttons visible when a value is selected in both single and multiple mode.

We'll have a feature out for testing on next soonish :)

Barsnes commented 1 month ago

I have added this in #2130, but has not yet been pushed to the next tag. You can test this on https://next.storybook.designsystemet.no/

mimarz commented 2 weeks ago

Hey @TobiasHansen!

We have released this under the next tag along with some other improvements.

Please test them and let us know 🤞

TobiasHansen commented 5 days ago

@mimarz Sorry for the late response, thanks, works great now!