-
Notifications
You must be signed in to change notification settings - Fork 6.8k
wip: fix(virtual-scroll): make horizontal scrolling work in RTL #12512
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
Changes from all commits
7da621d
4c25e86
d2ce70d
df672ee
cb132c8
d9fa498
6aedbcf
c018e6f
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 |
---|---|---|
|
@@ -35,6 +35,7 @@ cdk-virtual-scroll-viewport { | |
contain: strict; | ||
transform: translateZ(0); | ||
will-change: scroll-position; | ||
-webkit-overflow-scrolling: touch; | ||
} | ||
|
||
// Wrapper element for the rendered content. This element will be transformed to push the rendered | ||
|
@@ -44,7 +45,14 @@ cdk-virtual-scroll-viewport { | |
top: 0; | ||
left: 0; | ||
contain: content; | ||
will-change: transform; | ||
|
||
// Note: We can't put `will-change: transform;` here because it causes Safari to not update the | ||
// viewport's `scrollHeight` when the spacer's transform changes. | ||
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. nit: might sound a little weird, but we could even have a unit test for this if we want to be super sure that it never gets reintroduced. E.g. the test would just be 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. I actually did add some unit tests that verify the |
||
|
||
[dir='rtl'] & { | ||
right: 0; | ||
left: auto; | ||
} | ||
} | ||
|
||
.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper { | ||
|
@@ -67,7 +75,9 @@ cdk-virtual-scroll-viewport { | |
height: 1px; | ||
width: 1px; | ||
transform-origin: 0 0; | ||
will-change: transform; | ||
|
||
// Note: We can't put `will-change: transform;` here because it causes Safari to not update the | ||
// viewport's `scrollHeight` when the spacer's transform changes. | ||
|
||
[dir='rtl'] & { | ||
right: 0; | ||
|
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.
Shouldn't all of the
protected
properties be underscored?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.
I think we want people to extend their own components from this if they act as a viewport. Therefore the
protected
properties are kind of a part of the public API and should not be underscored