From 88d281ae447ac3db8c49b71a5a6a502a31dd7f93 Mon Sep 17 00:00:00 2001 From: Juwon Jeong Date: Mon, 25 Nov 2024 17:10:08 +0900 Subject: [PATCH 1/7] WRR-11077: Added Scroller qa-sampler for case where it is used with FixedPopupPanels Enact-DCO-1.0-Signed-off-by: Juwon Jeong (juwon.jeong@lge.com) --- samples/sampler/stories/qa/Scroller.js | 32 ++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/samples/sampler/stories/qa/Scroller.js b/samples/sampler/stories/qa/Scroller.js index 7e340b2b8e..44b5cc3991 100644 --- a/samples/sampler/stories/qa/Scroller.js +++ b/samples/sampler/stories/qa/Scroller.js @@ -1284,3 +1284,35 @@ export const WithContentContainerOnFocus = () => { }; WithContentContainerOnFocus.storyName = 'With Content Container'; + +export const WithFixedPopupPanels = () => { + const [open, setOpenState] = useState(false); + + const handleOpen = useCallback(() => { + setOpenState(true); + }, [setOpenState]); + + const handleClose = useCallback(() => { + setOpenState(false); + }, [setOpenState]); + + return ( + <> + + +
+ + + +
+ Item A + Item B + + + + ); +}; + +WithFixedPopupPanels.storyName = 'With FixedPopupPanels' From 2adf9b9a0e40abae95c0c47a16360684d0b2dfc9 Mon Sep 17 00:00:00 2001 From: Juwon Jeong Date: Tue, 26 Nov 2024 08:59:38 +0900 Subject: [PATCH 2/7] Fix typo Enact-DCO-1.0-Signed-off-by: Juwon Jeong (juwon.jeong@lge.com) --- samples/sampler/stories/qa/Scroller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/sampler/stories/qa/Scroller.js b/samples/sampler/stories/qa/Scroller.js index 44b5cc3991..fbb688459d 100644 --- a/samples/sampler/stories/qa/Scroller.js +++ b/samples/sampler/stories/qa/Scroller.js @@ -1315,4 +1315,4 @@ export const WithFixedPopupPanels = () => { ); }; -WithFixedPopupPanels.storyName = 'With FixedPopupPanels' +WithFixedPopupPanels.storyName = 'With FixedPopupPanels'; From a14b3bb821481737f85f8ebf15a8ec0a184c6bf0 Mon Sep 17 00:00:00 2001 From: Juwon Jeong Date: Mon, 2 Dec 2024 15:27:27 +0900 Subject: [PATCH 3/7] Apply reveiw Enact-DCO-1.0-Signed-off-by: Juwon Jeong (juwon.jeong@lge.com) --- useScroll/useScroll.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/useScroll/useScroll.js b/useScroll/useScroll.js index 9b4338e1cc..1ee2fb1100 100644 --- a/useScroll/useScroll.js +++ b/useScroll/useScroll.js @@ -10,7 +10,7 @@ import {forward} from '@enact/core/handle'; import platform from '@enact/core/platform'; -import Spotlight from '@enact/spotlight'; +import Spotlight, {getDirection} from '@enact/spotlight'; import {spottableClass} from '@enact/spotlight/Spottable'; import {getContainerId} from '@enact/spotlight/src/container'; import {getTargetByDirectionFromPosition} from '@enact/spotlight/src/target'; @@ -270,6 +270,13 @@ const useThemeScroll = (props, instances) => { } } + function preventScroll (ev) { + if (Spotlight.isPaused() && getDirection(ev.keyCode)) { + ev.preventDefault(); + ev.stopPropagation(); + } + } + // Return return { @@ -285,6 +292,7 @@ const useThemeScroll = (props, instances) => { handleTouchStart, handleWheel, removeEventListeners, + preventScroll, scrollbarProps, scrollStopOnScroll, scrollTo, @@ -405,6 +413,7 @@ const useScroll = (props) => { handleTouchStart, handleWheel, removeEventListeners, + preventScroll, // scrollMode 'native' scrollbarProps, scrollStopOnScroll, // scrollMode 'native' scrollTo, @@ -417,6 +426,7 @@ const useScroll = (props) => { if (scrollMode === 'translate') { scrollProps.stop = stop; } else { + scrollProps.preventScroll = preventScroll; scrollProps.scrollStopOnScroll = scrollStopOnScroll; scrollProps.start = start; } From 6f35475eb4e9ff72980d4dab0766b9c8ac26e3b1 Mon Sep 17 00:00:00 2001 From: Juwon Jeong Date: Mon, 2 Dec 2024 15:31:02 +0900 Subject: [PATCH 4/7] Added changelog Enact-DCO-1.0-Signed-off-by: Juwon Jeong (juwon.jeong@lge.com) --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22367a8426..b667ec55c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ The following is a curated list of changes in the Enact sandstone module, newest changes on the top. +## [unreleased] + +### Fixed + +- `sandstone/Scroller` to prevent the native scrolling behavior caused by keydown events when a popup is open + ## [3.0.0-alpha.3] - 2024-12-02 ### Added From 67862d40ef79bff1a86607fca804fb635e6e619c Mon Sep 17 00:00:00 2001 From: Juwon Jeong Date: Mon, 2 Dec 2024 15:32:52 +0900 Subject: [PATCH 5/7] Pin enact branch to fix travis error Enact-DCO-1.0-Signed-off-by: Juwon Jeong (juwon.jeong@lge.com) --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a53f2d07ef..9b18c1b2e3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ install: - npm install - npm link - popd - - git clone --branch=develop --depth 1 https://github.com/enactjs/enact ../enact + - git clone --branch=feature/WRR-11077 --depth 1 https://github.com/enactjs/enact ../enact - pushd ../enact - npm install - npm run lerna exec -- --ignore enact-sampler --concurrency 1 -- npm --no-package-lock install From 01f65c8840d7ab0fbe4e5abe26ecfee3a3299c43 Mon Sep 17 00:00:00 2001 From: Juwon Jeong Date: Tue, 3 Dec 2024 11:07:41 +0900 Subject: [PATCH 6/7] Apply review Enact-DCO-1.0-Signed-off-by: Juwon Jeong (juwon.jeong@lge.com) --- samples/sampler/stories/qa/Scroller.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/sampler/stories/qa/Scroller.js b/samples/sampler/stories/qa/Scroller.js index fbb688459d..c5ca788f96 100644 --- a/samples/sampler/stories/qa/Scroller.js +++ b/samples/sampler/stories/qa/Scroller.js @@ -1290,11 +1290,11 @@ export const WithFixedPopupPanels = () => { const handleOpen = useCallback(() => { setOpenState(true); - }, [setOpenState]); + }, []); const handleClose = useCallback(() => { setOpenState(false); - }, [setOpenState]); + }, []); return ( <> @@ -1305,11 +1305,11 @@ export const WithFixedPopupPanels = () => {
- +
Item A Item B - + ); From d767bc4766ab6f0432a1cdc6a5d54c83b29ed07c Mon Sep 17 00:00:00 2001 From: Juwon Jeong Date: Thu, 5 Dec 2024 17:44:04 +0900 Subject: [PATCH 7/7] Revert enact branch in travis file Enact-DCO-1.0-Signed-off-by: Juwon Jeong (juwon.jeong@lge.com) --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9b18c1b2e3..a53f2d07ef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ install: - npm install - npm link - popd - - git clone --branch=feature/WRR-11077 --depth 1 https://github.com/enactjs/enact ../enact + - git clone --branch=develop --depth 1 https://github.com/enactjs/enact ../enact - pushd ../enact - npm install - npm run lerna exec -- --ignore enact-sampler --concurrency 1 -- npm --no-package-lock install