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
The scope of the select control #104
Comments
Some important potential distinctions to consider while researching:
|
@chancestrickland thanks but that's not necessarily the purpose of this issue. Those seem like behavior considerations and most of the ones you noted are actually style based solutions which Open UI does not try to go after. This discussion is for the semantic meaning of the So my desired outcome from this issue is to determine:
|
Makes sense to me for positioning, though is focus management not more of a behavioral thing we should be concerned with? And if it is, would that make a difference as to whether or not the two are separate controls or is there room for that kind of variance in a single spec? |
We discussed an attribute on select (i.e. This is also only valid in the conversation around slotted parts and breaking up select components, but I think it's a pretty common usecase and would make a pretty neat feature. |
Alrighty, here is a quick rundown of the research I did around whether searching should/shouldn't be an addition to Here are results for whether the component lib offered a search capability for a given name that is similar to the
So here's the breakdown across the component libs I looked at that had search functionality
Given the above numbers I'm personally indifferent here on whether this should live on the Another aspect to consider is the goal of each control. Once you can type into the control are you solely filtering the available options or can you also add to the options that may not be available? All of the libs above from what I found they only filtering, similar to One final item is the definition of a combobox:
Because we have So the initial options are:
I didn't include dropdown in the options because the general consensus is on |
I sent out a tweet to get a general idea from the webdev community: https://twitter.com/gregwhitworth/status/1272694314460573697 |
Based on one of the twitter poll comments, I agree that filtering/search is a user convenience for the select component. I would probably still make it opt-in, as it should only be needed if the number of options exceeds some limit, and would just be in the users way if there are something like less than 5 options to choose from. That said, I would still add have a separate combo box component (note, my thinking is half-baked here). Select is for cases when the users is only allowed to choose from a predefined set of options. Combo box is for cases when the users is also allowed to enter any arbitrary string value. Both offer a filter/search, but in different places in the UI. In select, the filter input is inside the popup (like in GitHub branch select). In combo Box, the filter input is the main control itself. The combo box component lends itself better to chip/token inputs, than a select. If we try to combine the two into one control, I feel it’s going to be difficult to cover all use cases nicely. Does it make a difference whether the options in the list translate easily to string values? For example, git branch name vs icon/image? I could imagine using either a select or a combo box for the branch name, but for the icon/image, select would seem more natural somehow. |
My vote is for attr on select, which is a graceful fallback when not implemented in a browser. IF instead the idea was that the text field would become a free-text-input in the case where no match is found within the option list... then no, that's a new element entirely. I should never get unexpected field values from a select element. |
Amelia Bellamy-Royds had a great suggestion that we should consider which is that this should be provided by default and not use an attribute nor a new element.
original tweet and there is a decent amount of support for this. And then if you consider that the data above shows that 7/9, whether they be a |
My inclination is to modify …UNLESS |
One other thing to mention is that Firefox already has an experimental implementation of a search-filter feature for select elements. (Enabled by the I don't think the Firefox widget is a best pattern yet. (Firefox tracking bug. For one thing, keyboard accessibility seems lacking — I can't figure out how to focus the search field from keyboard alone, and without focusing the search field, it just does regular left-to-right typeahead, instead of filtering. The Firefox widget also currently only works on drop-down selects. Adding it to multi-line selects (list boxes) would be a little trickier — for web compat, you can't change the layout size of the list, but you also can't change the number of items initially visible, since web page authors may be counting on both of those to match the So maybe there is a value in adding an attribute for an author to request search controls (even on listbox-style selects, or even on short lists), while still allowing browsers to automatically include it where it is clearly the more user-friendly option. So there is definitely still much to discuss about how best to implement a filterable list selection widget. But compared to the other options (a new element, or a new validation constraint attribute on P.S., Here's my demo page, if anyone wants to play around with existing browser implementations of listbox, drop-down select, and combobox ( |
One more thing, since the issue title is broadly “thescope of the select control”: I also strongly support user agents enhancing the presentation of |
@AmeliaBR yeah - the primary thing I'm trying to derive from this is "searching" a part of
Yeah, I haven't gotten to the Note: *The web platform is only one implementation of an Open UI spec and when changes to HTML are suggested based on the Open UI spec we'll of course need to take into account web compat. This may or may not impact the need to opt-in for searching. While looking at other aspects of the Open UI spec from a web platform perspective we think we'll need an opt-in no matter what. But that's a separate discussion to have in WHATWG. |
I’m not sure I would want this by default. There are many cases where a
user would not be aware of the options prior to opening the drop down (ie.
company services or packages). Likely those would coincide with a shorter,
more digestible list of options. An input with a typing indicator may be
confusing in these cases. The filtering mechanism is most useful when a
user knows the input value (ie. selecting a country).
- Una
…On Tue, Jun 16, 2020 at 3:18 PM Amelia Bellamy-Royds < ***@***.***> wrote:
One other thing to mention is that Firefox already has an experimental
implementation of a search-filter feature for select elements. (Enabled by
the dom.forms.selectSearch flag in about:config).
[image: Screenshot of the Firefox widget. A select box with a drop-down
list, with a search input box at the top of the drop-down. The search field
has the word “green” and the list contains CSS named colors filtered to
only include those with the word “green” somewhere in the name.]
<https://user-images.githubusercontent.com/9876129/84814458-c87d4c80-afce-11ea-9aa5-a54994757827.png>
I don't think the Firefox widget is a best pattern yet. (Firefox tracking
bug <https://bugzilla.mozilla.org/show_bug.cgi?id=1332301>. For one
thing, keyboard accessibility seems lacking — I can't figure out how to
focus the search field from keyboard alone, and without focusing the search
field, it just does regular left-to-right typeahead, instead of filtering.
The Firefox widget also currently only works on drop-down selects. Adding
it to multi-line selects (list boxes) would be a little trickier — for web
compat, you can't change the layout size of the list, but you also can't
change the number of items initially visible, since web page authors may be
counting on both of those to match the size attribute predictably. Even
for drop-downs, the current Firefox implementation is only adding the
search box for long lists.
So maybe there is a value in adding an attribute for an author to request
search controls (even on listbox-style selects, or even on short lists),
while still allowing browsers to automatically include it where it is
clearly the more user-friendly option.
So there is definitely still much to discuss about how best to implement a
filterable list selection widget. But compared to the other options (a new
element, or a new validation constraint attribute on <input datalist>), I
do strongly encourage this to be pursued as an enhancement to <select>.
It has the most consistent fallback behavior. Users on new user agents
would get the better user experience, but users on older user agents would
still be able to select a valid value from the list.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#104 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAM5L3CCCWWKVD44273ERSDRW7APRANCNFSM4NS5CDTQ>
.
|
I don't necessarily disagree that the user benefit probably changes based on the content. But looking across the content libs and OSes they are all on by default (those that offer them of course). Clicking (or invoking) the input achieves the same as the current button to open the popup. So the user can use either approach. And while very limited in capability, the browsers' |
There was agreement amongst the group that text input should be possible on the select element, so this isn't solely a capability for a For this specific issue however I'm going to close it out as we have determined that the scope of the select does allow for search input. There was also general agreement that a |
In discussing the
<select>
with some people there is a desire to allow for an input to allow filtering of the available options. Some component libraries bundle this in with their select and others refer to this as a combo box. I'm going to do some research as I think it's important to ensure that the anatomy we're defining allows this extensibility if we believe it to be an expected part of the<select>
.The text was updated successfully, but these errors were encountered: