Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

选择框层级问题 #3594

Closed
lloydzhou opened this issue May 16, 2023 · 4 comments
Closed

选择框层级问题 #3594

lloydzhou opened this issue May 16, 2023 · 4 comments
Labels
type: discussion 讨论 Usage questions, guidance, and other discussions

Comments

@lloydzhou
Copy link
Contributor

Describe the bug

  1. 节点按添加顺序有zIndex
  2. 选择框selection整个在svg上层
  3. 所以会出现一种情况,选择的节点位于某个节点下层,但是选中之后selection的nodeSelectionBox位于最上层。
  4. 这个时候会出现层级交叉的情况

Your Example Website or App

https://x6.antv.antgroup.com/tutorial/plugins/selection

Steps to Reproduce the Bug or Issue

  1. 打开官方文档示例
  2. Hello节点和Rect节点拖动到有部分重叠
  3. 此时选择处于底层的Rect节点
  4. 这个时候,Rect节点处于Hello节点后面,但是和Rect节点应该是一体的nodeSelectionBox却位于Hello节点上层

Expected behavior

N/a

Screenshots or Videos

image

Platform

  • OS: [Linux]
  • Browser: [Chrome]
  • Version: [e.g. 91.1]

Additional context

No response

@lloydzhou
Copy link
Contributor Author

https://codesandbox.io/s/html-shape-for-x6-0y71sv?file=/html.ts:2989-2995

可以考虑参考 x6-html-shape这个包的逻辑,在选中的时候,将当前节点的zIndex临时设置到最顶层?或者调用toFront将选择的节点放到最顶层?

@NewByVector
Copy link
Contributor

我理解上面的现象是正常的,选择框是标记该节点被选中的状态,应该是显示在最上层,它和节点是否在最上层没有关系,这样用户很明显发现被选中的元素,特别是一个元素被完全覆盖在另一个节点内部的场景中会比较实用。也可以参考 drawio、excalidraw 的交互。

image

@NewByVector NewByVector added the type: discussion 讨论 Usage questions, guidance, and other discussions label May 16, 2023
@lloydzhou
Copy link
Contributor Author

如果与业界其他产品的交互一致,那还是保持原样吧

@x6-bot
Copy link
Contributor

x6-bot bot commented May 17, 2024

This thread has been automatically locked because it has not had recent activity.

Please open a new issue for related bugs and link to relevant comments in this thread.

@x6-bot x6-bot bot locked as resolved and limited conversation to collaborators May 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: discussion 讨论 Usage questions, guidance, and other discussions
Projects
None yet
Development

No branches or pull requests

2 participants