-
Notifications
You must be signed in to change notification settings - Fork 680
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
[css-forms-1] Can we simplify select::picker(select)
?
#11394
Comments
The idea is to require the argument for now to make it easier to roll this out to other elements over some period of time. Once we are satisfied and have covered all elements that need it, we can make the argument optional (to Documenting that in a note makes sense to me. cc @nt1m |
You can just write |
But this is a deviation from what we currently write. For example, it’s
Is there a reason why we can’t do that now? I understand that |
The main reason is to avoid compat hazard. If someone writes
Right now it would only apply to select, but as support for more pickers are added (datepicker etc.), that rule would start applying to more things (potentially against the will of the author, or not as they expect). Having a mandatory argument during the transitional period, allows pickers to be incrementally rolled out control by control without compat problems. |
I'll let @fantasai comment on whether this is a reasonable alternative to a mandatory argument. |
Unfortunately we cannot rely on DevRel or specification guidance. Web developers will use all permutations of an API and rely on them. We have to design it in a way such that it cannot be misused. |
(Disclaimer: I haven’t been involved in any of the discussions that lead to this selector, so I am most likely missing a lot of backstory and info … this is me personally looking at it without any extra knowledge about it.)
Every time I see customizable select demos, the
select::picker(select)
stands out to me … in a weird way. It feels very weird because of the extraselect
at the end there. To me,select::picker(select)
reads as “Give me theselect
that is part of the::picker
which belongs to the<select>
”. Huh?The spec reads that the argument to
picker()
is the unique picker name that you want to target, and for<select>
that isselect
. But that feels redundant to me, because theselect
at the start ofselect::picker(select)
already implies that you are trying to access something related to the<select>
element.Looking at the explainer https://open-ui.org/components/customizableselect/#styling (which I don’t know if it’s up-to-date or not) it says the pseudo targets the popover that contains the options that you can choose from. But AFAICT there is only popover per control. I also looked at #10462, #10758, and #10440 but could not find back an exact explanation to why the extra
select
at the end is required.This leads to me these questions:
select::picker()
gives you whatselect::picker(select)
currently gives you.::picker
… so for<select>
it could choose theselect
unique picker name and for something like a date-picker it (in the future) would use the one for that control.I’m sure I’m missing a lot of info/backstory here, so feel free to enlighten me on why this extra
picker
is absolutely necessary.Perhaps, if this can’t be simplified, the spec could add a note that explains the reasoning behind it?
/cc @josepharhar @annevk @dbaron @fantasai who participated in the previous discussions on this.
The text was updated successfully, but these errors were encountered: