-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add a new LabelPosition
of inside
to InputControl
#55963
Comments
This change adds a new `LabelPosition` value of `inside` to `InputControl`, allowing consumers to render the label visually inside the field. Resolves #55963
A new label position |
Thank you for working on this!
Is this related to the work on Data View: searching and filtering? For that specific scenario, do you think that adding a new label position for input control is the optimal solution, or could also evaluate alternatives? I'm mainly asking because I want to make sure that we're making the best decision here. Before going ahead, it's probably a good idea to get some feedback from @WordPress/gutenberg-design too |
Yes, this is for the data views filtering work...
I considered a few options:
I discounted the first option as being a lot of work that would mostly duplicate existing functionality, for relatively little gain. Equally, I discounted the idea of changing how prefixes/suffixes work, because I couldn't think of any obvious use-cases beyond labelling to make the work worthwhile. The third option of providing an ID in combination with a prefixed Given the somewhat specific use-case here, I'm happy to simply pass in an ID and a |
Thank you for the context. I agree with the approach that you proposed, and I'm just going to add a few nuances:
|
If the current situation is short-term, and the the plan is to rebuild the filters entirely (option one, above), then it might actually be better to leave This will mean fewer moving parts, and no potential issues for breaking |
👋 I just wanted to share that the |
Thanks for the issue! @oandregal is this issue still relevant with the updates you've made in filters? Or @andrewhayward has this been resolved here: #56001? |
I think that the immediate need for the Data Views project has already been addressed with #56001 , although this issue can still stay open as a low-priority general improvement for the |
What problem does this address?
A use-case has emerged for
InputControl
to put the label inside of the control wrapper.This is not currently possible to do properly, and as such the consumer is using the
prefix
prop instead. This means that the input does not have an accessible name, and that part of the field is not clickable.What is your proposed solution?
A new
LabelPosition
ofinside
should be added toInputControl
, to allow consumers to put the label inside of the field, and not misuse theprefix
option. This will better ensure that inputs are appropriately named.The text was updated successfully, but these errors were encountered: