Combobox updates before V1 #2610
Labels
♿️ accessibility
Issues related to accessibility
☂️ epic
Issues ready
react
@digdir/designsystemet-react
Milestone
We have some issues and API changes we want to make to the Combobox before V1.
This issue is a collection of issues we want to fix
Tasks
Combobox
withmultiple: false
#2702Some of these might already be fixed, but the issues have not been closed.
Some key points:
aria-hidden
Things to explore:
Should we change the API? This depends on our other form components, and a key discussion point here is having an API to place input, tags, etc. - This might need to be discussed after the points listed below.
It has been suggested to use u-tags and u-datalist. We can explore this.
A pros is that it seems to work for a simple combobox. A con is that we might lock ourselves into not being able to add more functionality to our combobox, which is the main reason why we wanted to create this component without a library. We want to add a
Combobox.Custom
, loading, and the ability to add a custom value. There might be a middleground to this, but usage of this needs to be thoroughly investigated.Should we still have a fake focus? Currently the input always has the real focus, and the options has a virtual focus. Could we handle this better by moving focus when the user starts typing? pros/cons?
Can we use the popover api to handle the list? This would mean we can drop floating-uis portal, which we have seen issues with.
Does virtual items work today, could it be improved? We use
@tanstack/react-virtual
today, which has been nice to work with, but is it nice to use for end users?Our controlled state has some edgecases we have not accounted for (see linked issues in tasklist). Should we rewrite this? This should come after the points above have been discussed and explored.
This is currently the only cmponent where you can use a portal. This means that
data-color
anddata-size
will not work for anything that is inside a portal. We should explore using the popover API here.The text was updated successfully, but these errors were encountered: