Skip to content

fix(list-monitor): wire touch events to resize handle#10066

Open
Chessing234 wants to merge 1 commit intoscratchfoundation:developfrom
Chessing234:fix/list-monitor-touch-resize
Open

fix(list-monitor): wire touch events to resize handle#10066
Chessing234 wants to merge 1 commit intoscratchfoundation:developfrom
Chessing234:fix/list-monitor-touch-resize

Conversation

@Chessing234
Copy link
Copy Markdown

Bug

List monitors cannot be resized on touchscreen devices. The resize handle (=) registers only onMouseDown / mousemove / mouseup, so dragging on a phone or tablet has no effect.

Fixes #9821.

Root cause

handleResizeMouseDown in src/containers/list-monitor.jsx already uses getEventXY from src/lib/touch-utils, which normalises both MouseEvent and TouchEvent coordinates. The logic is touch-aware; the events were simply never registered.

src/components/monitor/list-monitor.jsx passes onResizeMouseDown to onMouseDown only — there is no onTouchStart binding on the resize <div>.

Fix

Two files, five lines added:

src/components/monitor/list-monitor.jsx — add onTouchStart alongside onMouseDown on the resize div so the handler fires on touch devices.

src/containers/list-monitor.jsx — register touchmove / touchend alongside mousemove / mouseup when the drag starts, and remove them symmetrically in the cleanup closure.

No coordinate-extraction changes are needed because getEventXY already handles both event types.

The resize handle registered onMouseDown / mousemove / mouseup only, so
drag-to-resize was completely non-functional on touchscreens. getEventXY
(already imported from touch-utils and used inside handleResizeMouseDown)
normalises both mouse and touch coordinates, so no extra extraction logic
is needed — the events just needed to be registered.

Adds onTouchStart to the JSX resize div and registers touchmove / touchend
alongside their mouse equivalents, with symmetric cleanup in onMouseUp.

Fixes scratchfoundation#9821.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot resize lists on mobile

1 participant