[InputLabel] Fix shrunk label click not focusing input #16215
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reverts #13040 but should not regress from #12997
Fixes clicking shrunk labels not focusing their associated input: https://deploy-preview-16215--material-ui.netlify.com/components/text-fields/#outlined
I think the issue with #12997 was that the label was not associated with the input.
pointer-events: none
fixed the apparent issue but hides a deeper issue with the a11y of the text field.We should optimize for proper a11y setups in which a click on a shrunk label would not focus the text field. Depending on the layout
pointer-events: none
could prevent the default label-input UX.Would like some feedback about the new cursor logic. I'd be fine without cursor: text trickery. Problem without cursor: text the cursor behaves different on outlined vs standard text fields. But with it you get a short flash when clicking on shrunk labels.
TODO: