-
Notifications
You must be signed in to change notification settings - Fork 601
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
use CSS transitions and transforms in horizontal scroll #5193
use CSS transitions and transforms in horizontal scroll #5193
Conversation
@@ -45,7 +46,7 @@ export const horizontalScrollTemplate: FoundationElementTemplate< | |||
part="scroll-prev" | |||
${ref("previousFlipperContainer")} | |||
> | |||
<div class="scroll-action"> | |||
<div class="scroll-action" part="scroll-action-previous"> |
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.
This is great - thank you!
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.
Thanks for this @radium-v!
Also, I pulled this down, built, smoked - definitely smoother on my mac :) |
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.
Smooth like butter, Thanks for doing this John!
packages/web-components/fast-foundation/src/horizontal-scroll/horizontal-scroll.ts
Outdated
Show resolved
Hide resolved
packages/web-components/fast-foundation/src/horizontal-scroll/horizontal-scroll.ts
Outdated
Show resolved
Hide resolved
packages/web-components/fast-foundation/src/horizontal-scroll/horizontal-scroll.ts
Outdated
Show resolved
Hide resolved
82f742a
to
a8d464b
Compare
a8d464b
to
2d9461e
Compare
f33a2c4
to
19d002d
Compare
19d002d
to
fbc3686
Compare
packages/web-components/fast-components/src/horizontal-scroll/horizontal-scroll.pw.spec.ts
Outdated
Show resolved
Hide resolved
packages/web-components/fast-foundation/src/horizontal-scroll/horizontal-scroll.ts
Outdated
Show resolved
Hide resolved
- fix playwright test
fbc3686
to
b6719f4
Compare
Pull Request
📖 Description
ResizeObserver
andIntersectionService
files tosrc/utilities
infast-foundation
🎫 Issues
👩💻 Reviewer Notes
The first approach used
requestAnimationFrame
to approximate the screen refresh rate. This new approach uses CSS transforms in conjunction with scrolling to transition the contents into place. Ontransitionend
, we then setscrollLeft
on the same frame that we remove thetransform
. The key is that thetransition-duration
is set to0s
while this happens.📑 Test Plan
Tested in Chrome, Edge, and Firefox at 60hz, 120hz, 165hz, and 240hz.
✅ Checklist
General
$ yarn change
Component-specific