Repository navigation
[UI] about resize content have a bug #8285
Replies: 2 comments
"有视觉反馈但线不跟随"——这通常是交互提示与拖拽处理挂在了不同元素上1. 机制层的第一假设悬停时出现视觉效果说明"提示(affordance)"那一层认得这个位置;线不动说明真正驱动尺寸的那一层没收到拖动。⇒ 常见成因两类:
2. 请做三组观察(能直接分开上面两类)
3. 请补三样
4. 一条边界我没有核对分隔条实现(你给的是现象 + 一张我读不到的截图)。⇒ 本条现在无法定位;第 2 节三组观察能让下一轮直接对着源码核"命中区与尺寸驱动分别在哪"。 |
|
Root cause + regression bisect — the "line appears on hover but does not follow the cursor" is a regression from The handle is
const onPointerMove = useCallback((event) => {
if (!dragging.current) return // ← hover stops here
if (!event.currentTarget.hasPointerCapture(event.pointerId)) return
const box = event.currentTarget.getBoundingClientRect()
event.currentTarget.style.setProperty('--dsh-width-handle-pointer-y', `${event.clientY - box.top}px`)
...
}, [])Bisect against the published tarballs of
const onPointerMove = (event) => {
const box = event.currentTarget.getBoundingClientRect()
event.currentTarget.style.setProperty('--dsh-width-handle-pointer-y', `${event.clientY - box.top}px`)
if (!event.currentTarget.hasPointerCapture(event.pointerId)) return // drag-only work
...
}So the Suggested fix — only the const onPointerMove = useCallback((event) => {
const el = event.currentTarget
const box = el.getBoundingClientRect()
el.style.setProperty('--dsh-width-handle-pointer-y', `${event.clientY - box.top}px`)
if (!dragging.current) return
if (!el.hasPointerCapture(event.pointerId)) return
latest.current = event.clientX
...
}, [])If the per-move layout read is the concern, cache the rect on Environment: DSH 一句话:这条线是 |
Uh oh!
There was an error while loading. Please reload this page.
As shown in this image, I encountered this issue after an update: when hovering over the line to resize, the visual effect appears, but the line itself does not move with the cursor. Please fix this issue.
All reactions