-
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
fix(ripple): Listen for up events at document level #1800
Changes from 1 commit
a8d4c20
05ae636
97769c4
463d266
0a8112e
9b2aae7
91f061c
fcaf741
e55a962
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -234,6 +234,26 @@ testFoundation('adds activation classes on programmatic activation', ({foundatio | |
td.verify(adapter.addClass(cssClasses.FG_ACTIVATION)); | ||
}); | ||
|
||
testFoundation('programmatic activation immediately after interaction', ({foundation, adapter, mockRaf}) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A more descriptive name would be helpful (something like "programmatic activation that occurs immediately after interaction adds the FG activation class") There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I make the description any longer it will overflow our maximum line length, and that's usually where I draw the line... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hahaha fair enough :) Approved! |
||
const handlers = captureHandlers(adapter, 'registerInteractionHandler'); | ||
const documentHandlers = captureHandlers(adapter, 'registerDocumentInteractionHandler'); | ||
|
||
td.when(adapter.isSurfaceActive()).thenReturn(true); | ||
foundation.init(); | ||
mockRaf.flush(); | ||
|
||
handlers.touchstart({changedTouches: [{pageX: 0, pageY: 0}]}); | ||
mockRaf.flush(); | ||
documentHandlers.touchend(); | ||
mockRaf.flush(); | ||
|
||
foundation.activate(); | ||
mockRaf.flush(); | ||
|
||
td.verify(adapter.addClass(cssClasses.BG_ACTIVE_FILL), {times: 2}); | ||
td.verify(adapter.addClass(cssClasses.FG_ACTIVATION), {times: 2}); | ||
}); | ||
|
||
testFoundation('sets FG position to center on non-pointer activation', ({foundation, adapter, mockRaf}) => { | ||
const handlers = captureHandlers(adapter, 'registerInteractionHandler'); | ||
const left = 50; | ||
|
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 the
setTimeout
to account for delays between when same-interaction "follow-on" events are triggered?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.
Yup. Do you think my comment above these lines needs improvement?
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, explanation about why the 100ms delay would be nice. I get why it's there now that I really read through but on first pass it's a little confusing.