antvis / antvis/G6

[Bug]: When you add a layout in collapse-expand, it will jump when you open the node by double clicking.

Open
#6,769 2 comments 0 reactions 0 assignees View on GitHub
bug 🐛
Dominant language
TypeScript
Stars
12.3k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug / 问题描述

```
import { Graph } from '@antv/g6';

const graph = new Graph({
container: 'container',
layout: {
type: 'circular',
},
data: {
nodes: [
{ id: 'node1', combo: 'combo1' },
{ id: 'node2', combo: 'combo1' },
{ id: 'node3'},
{ id: 'node4', combo: 'combo1', },

],
edges: [
{ source: 'node1', target: 'node2' },
{ source: 'node1', target: 'node3' },
{ source: 'node4', target: 'node1' },

],
combos: [{ id: 'combo1',style: { x: 350, y: 300,collapsed: true, } }],
},
behaviors: ['collapse-expand', 'drag-element'],

});

graph.render();
```

The above example is taken from the following site:
https://g6.antv.antgroup.com/en/examples/behavior/combo#basic

After adding layout, drag the collapsed node or try to expand it by double-clicking. It will suddenly jump to the top. How can I prevent this behavior?

### Reproduction link / 复现链接

_No response_

### Steps to Reproduce the Bug or Issue / 重现步骤

### Version / 版本

🆕 5.x

### OS / 操作系统

- [ ] macOS
- [x] Windows
- [ ] Linux
- [ ] Others / 其他

### Browser / 浏览器

- [x] Chrome
- [ ] Edge
- [ ] Firefox
- [ ] Safari (Limited support / 有限支持)
- [ ] IE (Nonsupport / 不支持)
- [ ] Others / 其他

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the collapse-expand example at the linked G6 documentation page and reproduce the behavior using the TypeScript snippet with circular layout and a collapsed combo. Trace the interaction between layout, dragging, and double-click expansion; done means the collapsed node does not jump to the top when dragged or expanded.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.