antvis / antvis/X6

view:mounted事件触发时,节点渲染不完整

Open
#4,253 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
6.7k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

### 问题描述

view:mounted事件触发时,节点渲染不完整,只渲染了一个最外层的g标签
![image](https://github.com/antvis/X6/assets/16225782/5a7feaec-99fd-4342-8868-4d1c867c7db9)
![image](https://github.com/antvis/X6/assets/16225782/5360bc49-2a01-4569-ab13-2632b4e4105d)

### 重现链接

https://codesandbox.io/p/sandbox/view-mountedshi-jian-chu-fa-shi-jie-dian-xuan-ran-bu-wan-zheng-mcxlwr?file=%2FApp.tsx%3A89%2C15

### 重现步骤

1.进入页面
2.打开控制台
3.查看打印信息(为view:mounted事件回调参数的container的子元素个数)

### 预期行为

我希望看到打印出节点渲染完成后的正确的子元素个数。实际结果为每个节点触发该事件时,子元素个数都是0.

### 平台

- 操作系统: [macOS]
- 网页浏览器: [Google Chrome]
- X6 版本: [2.18.1 ...]

### 屏幕截图或视频(可选)

_No response_

### 补充说明(可选)

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the linked CodeSandbox reproduction, especially App.tsx around line 89, and inspect the view:mounted callback's container. Confirm when the event fires relative to child rendering and compare the logged child count with the expected completed node structure. Done means the callback observes the fully rendered node rather than a container with zero children.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.