-
Notifications
You must be signed in to change notification settings - Fork 2.1k
fix(notched-outline): Auto position the notch and floating label based on corner size #3929
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3929 +/- ##
==========================================
- Coverage 98.52% 98.48% -0.04%
==========================================
Files 120 120
Lines 5224 5227 +3
Branches 657 657
==========================================
+ Hits 5147 5148 +1
- Misses 77 79 +2
Continue to review full report at Codecov.
|
96c0753
to
3a1b4e3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM since this resolves the bug. After talking to design it looks like we want the notch to move closer to the corner so the label is more inline with the input text and helper text. Filed #3936 to resolve that issue so we can tackle that later.
…r large radius size
🤖 Beep boop! Screenshot test report 🚦8 screenshots changed from Details |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I got the following error after upgrading to this version (0.41.0) and using the standard implementation from the readme. The error seems to be related to the changes in this PR. Downgrading to the previous version (0.40.1) resolves the issue.
|
@riichard your textfield and shape package versions are out of sync. See #4038 (comment). |
This change fixes the issue where notched outline overlaps with floating label on text field & select components.
Notch position is calculated based on the corner size of notched outline and accordingly the shape mixins in text field and select components sets the floating label position based on radius size.
The leading stroke length is calculated with:
Math.max(0, numbers.MIN_LEADING_STROKE_EDGE_POSITION - radius - 1.2)
which gets shrunk when large radius is used.The floating label position calculation with:
$cornerSize + $leadingStrokeLength + $mdc-notched-outline-notch-gutter-size + 1.2
where$leadingStrokeLength
is the stroke length that applies the same formula as above.Fixes #3158, #3936