Repository navigation
fix(native): smooth Input focus on 3.0 (port of #402) - #403
Merged
Merged
Conversation
…ng (#402) Before, focusing an empty field snapped the label to the top and pulled the text control out of an invisible overlay into the flow, and on the web demo the browser drew its own ring around the text line inside the field's border. The label now animates (transform only, native driver, none with reduce motion) while the text control stays put, and the inner ring is off: the field's border already shows focus. Claude-Session: https://claude.ai/code/session_01WH2VptULRpwysRyx2fUFos Co-authored-by: Claude <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Before: on the 3.0 branch, a native Input's label jumps from the middle of the field to the top when you focus it, and on web the inner text control draws its own browser focus ring inside the field.
After: the label moves up and shrinks in one 150ms animation, which is skipped when reduce motion is on, and the inner browser ring is gone, so the field's own focus border is the only one.
How: this is a cherry-pick of #402 from
preview. The label is an animated, absolutely positioned layer that is lifted by translateY and scale. The text control keeps its place under the label, andoutlineWidth: 0turns off the inner ring. The label uses the 3.0 prop nametextVariant. Typecheck, biome, jest (149), vitest (107) andcheck:aiall pass locally.Generated by Claude Code