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

ActionTreeNode下拉框,点击任意选项会触发onSelect #17

Open
AppianZ opened this issue Jan 14, 2019 · 0 comments
Open

ActionTreeNode下拉框,点击任意选项会触发onSelect #17

AppianZ opened this issue Jan 14, 2019 · 0 comments
Assignees

Comments

@AppianZ
Copy link

AppianZ commented Jan 14, 2019

[缺陷描述]:有一个树节点, 如例子demo中的

<Tree
            selectable={true}
            onSelect={(key, e) => {console.log('onSelect')}}
          ></Tree>
<ActionTreeNode
            key={item.key}
            title={item.title}
            actionAble
            actions={[{
              text: '新增',
              onClick: () => { console.log('lalalazzz'); },
            }]}
          >
            {loopDropDown(item.children)}
          </ActionTreeNode>

[重现步骤]: 

  1. 给 Tree 绑定 onSelect
  2. 给 ActionTreeNode 绑定actions;
  3. 点击下拉框中的 “新增”
  4. log 两次: lalalazzz + onSelect

[期望结果]:

  1. 只希望 log 一次 lalalazzz
  2. 并且希望 actions 的onclick事件传的参数和 onSelect的一致

[实际结果]:

[原因定位]:
https://github.com/uxcore/uxcore-tree/blob/master/src/ActionTreeNode.jsx#L83
这里希望阻止事件冒泡,并且传一些重要的参数。

[修复建议]:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants