Skip to content
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

WRN-6761: VirtualGridListNative keeps scrolling after rotated while scrolling in Android #2987

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ The following is a curated list of changes in the Enact project, newest changes

### Fixed

- `ui/Scrollable/ScrollableNative` to stop scroller momentum when the window resizes
- `ui/useScroll/useScroll` to stop scroller momentum when the window resizes
- `spotlight/SpotlightRootDecorator` to show focus effect after initial loading
- `ui/MarqueeDecorator` to restart animation when text changed while focus retained

Expand Down
12 changes: 11 additions & 1 deletion packages/ui/Scrollable/ScrollableNative.js
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,19 @@ class ScrollableBaseNative extends Component {
if (handleResizeWindow) {
handleResizeWindow();
}
if ( platform.platformName === 'androidChrome' || platform.platformName === 'ios' ) {
this.childRefCurrent.containerRef.current.style.overflow = 'hidden';
}
this.childRefCurrent.containerRef.current.style.scrollBehavior = null;

this.childRefCurrent.scrollToPosition(0, 0);
this.childRefCurrent.containerRef.current.style.scrollBehavior = 'smooth';

setTimeout(() => {
if ( platform.platformName === 'androidChrome' || platform.platformName === 'ios' ) {
this.childRefCurrent.containerRef.current.style.overflow = '';
}
this.childRefCurrent.containerRef.current.style.scrollBehavior = 'smooth';
}, 100);

this.enqueueForceUpdate();
});
Expand Down
12 changes: 11 additions & 1 deletion packages/ui/useScroll/useScroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,9 +368,19 @@ const useScrollBase = (props) => {
if (scrollMode === 'translate') {
scrollTo({position: {x: 0, y: 0}, animate: false});
} else {
if ( platform.platformName === 'androidChrome' || platform.platformName === 'ios' ) {
scrollContentRef.current.style.overflow = 'hidden';
}
scrollContentRef.current.style.scrollBehavior = null;

scrollContentHandle.current.scrollToPosition(0, 0);
scrollContentRef.current.style.scrollBehavior = 'smooth';

setTimeout(() => {
if ( platform.platformName === 'androidChrome' || platform.platformName === 'ios' ) {
scrollContentRef.current.style.overflow = '';
}
scrollContentRef.current.style.scrollBehavior = 'smooth';
}, 100);
}

enqueueForceUpdate();
Expand Down