-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Text field boxes + Ripple Improvements #801
Conversation
Codecov Report
@@ Coverage Diff @@
## master #801 +/- ##
==========================================
+ Coverage 99.93% 99.93% +<.01%
==========================================
Files 68 68
Lines 3134 3144 +10
Branches 384 387 +3
==========================================
+ Hits 3132 3142 +10
Misses 2 2
Continue to review full report at Codecov.
|
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.
Here is a weird bug on my end.
If you select dark mode, right click on the box, left click outside the box to turn off the menu, left click again outside the box. You will see:
Not sure what causes this yet, @traviskaufman maybe you have a quick answer?
position: absolute; | ||
top: 0; | ||
left: 0; | ||
// TODO ripple positioning logic? |
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.
Is this associate with other issues? Feel better to leave a reference here
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.
Old TODO :p removing
assert.isNull(component.ripple); | ||
}); | ||
|
||
test('#constructor initializes a default ripple when no ripple factory given when given a ' + |
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.
How about "constructor initializes a default ripple when ripple factory is not given in mdc-textfield--box
element?"
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.
That to me sounds like there's some "ripple factory" inside of an mdc-textfield--box
element. How about: "#constructor when given a mdc-textfield--box
element, initializes a default ripple when no ripple factory given"
function setupTest() { | ||
const root = getFixture(); | ||
const component = new MDCTextfield(root); | ||
return {root, component}; | ||
} | ||
|
||
test('#adapter.initialSyncWithDom', () => { | ||
test('#initialSyncWithDom', () => { |
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.
How about "#initialSyncWithDom set disable to false"?
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.
One question and a few small issues, otherwise looks good!
bottom: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 1px; |
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.
Should this be higher? Spec says even when idle and empty, it should be 2dp, and the visual examples make the bottom line look taller.
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.
Yeah so this is a change that hasn't yet made it into spec. When we implement #675 it'll elevate to 2dp on hover, and stay at 2dp on focus.
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.
👍
demos/textfield.html
Outdated
tfEl.classList[evt.target.checked ? 'add' : 'remove']('mdc-textfield--dense'); | ||
tf.ripple.layout(); | ||
}); | ||
}, 80); |
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.
Doesn't need to be 80. Can just be 0 so it's at the end of the execution queue. I feel like potentially the issue is that by us using an arbitrary value, users just cutting and pasting code may think they need to do the same thing. To me, 0 seems like less of a directive.
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.
Yeah agreed that 0 is better; I didn't realize we could use 0. Hopefully sometime soon we'll have a more robust solution for loading these demo styles.
@@ -181,6 +181,10 @@ such as a `mousedown` or a `pointerdown` event). It expands from the center. | |||
Triggers a deactivation of the ripple (the second stage, which happens when the ripple surface is engaged via | |||
interaction, such as a `mouseup` or a `pointerup` event). It expands from the center. | |||
|
|||
#### MDCRipple.layout() |
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.
Yay!
|
||
&.mdc-ripple-upgraded { | ||
@include mdc-ripple-base; | ||
// TODO: Add ::before as ripple bg once #194 lands |
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.
It looks like the background fade out on the hover ripple doesn't exist, making it seem like it disappears very abruptly on interaction end events (moving the pointer out of the target). Do you have any sense of whether or not this component will receive ink wash on hover as a result of #194 ?
If it does not I think it will solve this problem as the ripple on click interactions fades out as expected.
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.
@amsheehan yeah it will. There is a fade out, but it is very quick (<100ms). You can see it in devtools if you slow down the animations using the "Animations" tab. I worked with motion design on it and they signed off on it, so I'm assuming it's correct?
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.
Curious. I had initially slowed it down but still couldn't see it animating out. I'm thinking the darker background of the text box background is the same color as the ink wash, which makes it appear as though there is no fade out. All the user can see is the foreground ripple (which doesn't animate out afaik)
Either way, if motion signed off, that's good enough for me. 👍
Can I make a request that we make the docs changes to |
- Remove foreground deactivation class after fg-opacity-out animation finishes such that additional repaints for the element don't retrigger animations.
Change made after additional review from the team's motion designers.
@amsheehan I can add the note about full width textfields as part of this PR for sure. |
89be862
to
b773120
Compare
@yeelan0319 @amsheehan PTAL! @yeelan0319 That bug looks like it's for the ripple. I will file an issue for it. |
@traviskaufman SGTM. LGTMed this PR. |
b773120
to
4c45efb
Compare
This PR constitutes a number of commits which resolve #673 and should be rebased and merged.