antvis/G6

beforecollapseexpandcombo 事件的action值无论是展开还是折叠都是expand #4737

zhang-yanglong posted onGitHub

Describe the bug

graph.on('beforecollapseexpandcombo', ({action, item}) => { item.get('model').label = action; }

Your Example Website or App

https://g6.antv.antgroup.com/zh/examples/item/defaultCombos/#rect

Steps to Reproduce the Bug or Issue

import G6 from '@antv/g6';

const data = { nodes: [ { id: 'node1', x: 250, y: 150, comboId: 'combo', }, { id: 'node2', x: 350, y: 150, comboId: 'combo', }, ], combos: [ { id: 'combo', label: 'Combo', }, ], };

const width = document.getElementById('container').scrollWidth; const height = document.getElementById('container').scrollHeight || 500; const graph = new G6.Graph({ container: 'container', width, height, fitCenter: true, groupByTypes: false, modes: { default: ['drag-canvas', 'drag-node', 'drag-combo', 'collapse-expand-combo'], }, defaultCombo: { type: 'rect', size: [50, 50], labelCfg: { position: 'top', }, }, });

graph.data(data); graph.render(); graph.on('beforecollapseexpandcombo', ({action, item}) => { item.get('model').label = action; })

Expected behavior

展开时为expand,折叠时为collapse

Screenshots or Videos

image image

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: [e.g. 91.1]

Additional context

No response


感谢报告,确实有这个问题,下个小版本修复

posted by Yanyan-Wang almost 2 years ago

This issue has been closed because it has been outdate for a long time. Please open a new issue if you still need help.

这个 issue 已经被关闭,因为 它已经过期很久了。 如果你仍然需要帮助,请创建一个新的 issue。

posted by github-actions[bot] 10 months ago

Fund this Issue

$0.00
Funded

Pull requests