Skip to content

fix: 悬浮容器首次加入工作区无法拖动 - #21246

Open
asd116725 wants to merge 1 commit into
baidu:masterfrom
asd116725:fix-draggable-container-can-not-drag
Open

fix: 悬浮容器首次加入工作区无法拖动#21246
asd116725 wants to merge 1 commit into
baidu:masterfrom
asd116725:fix-draggable-container-can-not-drag

Conversation

@asd116725

Copy link
Copy Markdown

What

悬浮容器首次加入内容区时候虽然悬浮容器看是选中了,但是无法拖拽,需要点击其他组件以后再次选中回来才能拖拽。

Why

因为执行useLayoutEffect 时候 node.getTarget() 返回的空数组,amis渲染器还未完成Dom的渲染,此处无法获取到。
image

How

添加150ms延迟来确保node.getTarget()拿得到。

@github-actions

Copy link
Copy Markdown

👍 Thanks for this!
🏷 I have applied any labels matching special text in your issue.

Please review the labels and make any necessary changes.

@github-actions github-actions Bot added the fix label Jan 11, 2026
@asd116725

Copy link
Copy Markdown
Author

Jan-11-2026 16-03-31

@wibetter

Copy link
Copy Markdown
Contributor
@asd116725

Copy link
Copy Markdown
Author

试下在这里会不会复现你说的问题:https://wibetter.github.io/amis-editor-demo/reports-demo/index.html#/hello-world

我的是官方源码fork过来跑的有这个问题

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

Labels

2 participants