WICG / virtual-scroller

Other
2k stars 83 forks source link

Use a content wrapper for applying transform to #107

Closed kenchris closed 6 years ago

kenchris commented 6 years ago

Also encapsulate the overflow-x: hidden in the shadow root

valdrinkoshi commented 6 years ago

Nice! Small suggestion: I'd set overflow: hidden instead of overflow-x: hidden, so that in case we update this element in the future to support different dismiss directions (e.g. to be used inside a horizontal virtual-scroller), this part would be already good to go. Also, maybe set it as an inline style on the #contentWrapper when we switch the state to dragging, and reset it to null when the gesture is done. This would completely hide this implementation detail from the outside world

kenchris commented 6 years ago

I originally set it on the #contentWrapper instead of on :host but then I still saw horizontal scrollbar while dragging.

valdrinkoshi commented 6 years ago

oh right - ofc 🤦‍♂️ LGTM! merging this

valdrinkoshi commented 6 years ago

and published too 👌 https://valdrinkoshi.github.io/virtual-scroller/demo/dismissable/