Skip to content

Commit

Permalink
Apply review to remove spotlight dependency in ui
Browse files Browse the repository at this point in the history
Enact-DCO-1.0-Signed-off-by: Juwon Jeong ([email protected])
  • Loading branch information
juwonjeong committed Dec 2, 2024
1 parent 0fe7fdb commit 727ac1d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
1 change: 0 additions & 1 deletion packages/ui/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ The following is a curated list of changes in the Enact ui module, newest change

### Fixed

- `ui/Scroller` to prevent the native scrolling behavior caused by keydown events when the popup is opened
- `ui/VirtualList` to re-render when the each size of variable sized items changed

## [5.0.0-alpha.2] - 2024-10-08
Expand Down
1 change: 0 additions & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"dependencies": {
"@enact/core": "^5.0.0-alpha.2",
"@enact/i18n": "^5.0.0-alpha.2",
"@enact/spotlight": "^5.0.0-alpha.2",
"classnames": "^2.5.1",
"ilib": "^14.20.0",
"invariant": "^2.2.4",
Expand Down
7 changes: 2 additions & 5 deletions packages/ui/useScroll/useScroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {is} from '@enact/core/keymap';
import {platform} from '@enact/core/platform'; // scrollMode 'native'
import Registry from '@enact/core/internal/Registry';
import {Job} from '@enact/core/util';
import Spotlight, {getDirection} from '@enact/spotlight';
import clamp from 'ramda/src/clamp';
import {useCallback, useContext, useEffect, useLayoutEffect, useReducer, useRef, useState} from 'react';
import warning from 'warning';
Expand Down Expand Up @@ -133,6 +132,7 @@ const useScrollBase = (props) => {
delete rest.onScrollStart;
delete rest.onScrollStop;
delete rest.onWheel;
delete rest.preventScroll;
delete rest.removeEventListeners;
delete rest.scrollStopOnScroll; // scrollMode 'native'
delete rest.scrollTo;
Expand Down Expand Up @@ -813,10 +813,7 @@ const useScrollBase = (props) => {
scrollByPage(ev.keyCode);
}
} else {
if (Spotlight.isPaused() && getDirection(ev.keyCode)) {
ev.preventDefault();
ev.stopPropagation();
}
props.preventScroll(ev);
forward('onKeyDown', ev, props);
}
}
Expand Down

0 comments on commit 727ac1d

Please sign in to comment.