angular-tree-component icon indicating copy to clipboard operation
angular-tree-component copied to clipboard

Event triggered twice when clicking node

Open cppleon opened this issue 7 years ago • 7 comments

"angular-tree-component": "^3.7.3"

  • component.html
<tree-root [nodes]="nodes" (focus)="onFocus($event)"></tree-root>
  • component.ts
onFocus(event) {
  console.log(event);
}

Result

Object {eventName: "focus", node: TreeNode, treeModel: TreeModel}
Object {eventName: "focus", node: TreeNode, treeModel: TreeModel}

cppleon avatar Jul 11 '17 12:07 cppleon

Same problem here. Also on the Focus event.

Maybe event bubbling could be the culprit.

Sedor avatar Sep 25 '17 13:09 Sedor

I have the same problem. Should probably be fixed since it will result in multiple API calls if you "do something" on focus.

blaur avatar Jan 29 '18 15:01 blaur

I have the same problem

ochan avatar Feb 16 '18 14:02 ochan

same problem. anyone got a way to make a node expand/close when focused given this issue? currently it will expand then close..

jacksonhart avatar Sep 02 '18 09:09 jacksonhart

same problem - clicking a node fires the focus event twice. At first, I thought it is firing for both the parent and the focused child but it is firing twice with the same node.

onepoordeveloper avatar Aug 29 '19 07:08 onepoordeveloper

Any feedback on this issue? Still seems to be a problem.

jschillingApollo avatar Feb 18 '21 22:02 jschillingApollo

For me clicking a node fires the event thrice.

kararkraj avatar Sep 12 '22 13:09 kararkraj