Skip to content

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

Open
@RackweLLizm

Description

@RackweLLizm

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
  • Windows
  • Linux
  • Others / 其他

Browser / 浏览器

  • Chrome
  • Edge
  • Firefox
  • Safari (Limited support / 有限支持)
  • IE (Nonsupport / 不支持)
  • Others / 其他

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛Something isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions