Open
Bug 2024753
Opened 8 months ago
Updated 7 months ago
Remove React 16 addEventListener workarounds for moz-select and moz-reorderable-list in Lists widget
Categories
(Firefox :: New Tab Page, defect, P3)
Firefox
New Tab Page
Tracking
()
NEW
People
(Reporter: maxx, Unassigned)
References
(Blocks 1 open bug)
Details
Summary:
The Lists widget uses useRef + useEffect + addEventListener to listen for change events on moz-select and reorder events on
moz-reorderable-list. This was required in React 16, which did not support custom element events via JSX props.
Now that newtab runs React 19 (Bug 2016217), these can be replaced with native JSX event props: onChange on <moz-select> and
onReorder on <moz-reorderable-list>.
Steps to fix:
content-src/components/Widgets/Lists/Lists.jsx:- remove
selectRefandreorderListRef - delete the
useEffectblock (lines ~165–195) - move
handleSelectChangeandhandleReorderto top-level functions - pass
onChange={handleSelectChange}andonReorder={handleReorder}as JSX props on the respective elements.
- remove
Comment 1•7 months ago
|
||
This cannot be fully done until React 19 hits release.
Severity: -- → S3
Priority: -- → P3
You need to log in
before you can comment on or make changes to this bug.
Description
•