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

Tree: addNode() returns parent node instead of added node #5334

Closed
kvsieminfor opened this issue Jun 18, 2021 · 1 comment · Fixed by #5687
Closed

Tree: addNode() returns parent node instead of added node #5334

kvsieminfor opened this issue Jun 18, 2021 · 1 comment · Fixed by #5687
Assignees
Labels
type: bug 🐛 [2] Velocity rating (Fibonacci)

Comments

@kvsieminfor
Copy link

Describe the bug
tree.addNode() returns the parent <li> instead of the added <li> when using setting nodeData.parent in the addNode() call.

To Reproduce

Steps to reproduce the behavior using attached example:

  1. Unzip ids-tree-addnode-returns-incorrect-li.zip
  2. Open IDS Enterprise.html
  3. Open console
  4. Note that the same <a> (node) element is logged twice, i.e. both addNode() calls return the same <li>.

Steps to reproduce the behavior using existing online example:

  1. Go to https://design.infor.com/code/ids-enterprise/latest/demo/components/tree/test-add-node
  2. Open console
  3. Enter the following:
    var api = $('#addnode-tree').tree().data('tree');
    let node1 = api.addNode({text: 'New Item 1', id: 'new1'});
    let node2 = api.addNode({text: 'New Item 2', id: 'new2', parent: 'new1'});
    console.log("child <a> returned when adding 'new1': ", node1.children('a').get(0))
    console.log("child <a> returned when adding 'new2': ", node2.children('a').get(0))
    console.log("<li> returned adding 'new1' equal to <li> returned adding 'new2'?", node1.get(0) === node2.get(0));
  1. Note that the same <a> (node) element is logged twice, i.e. both addNode() calls return the same <li>.

Expected behavior
addNode() should return the <li> of the new node regardless of where in the tree it was added.

Version

  • ids-enterprise: v4.52.0 (Note that while "latest" is said to be 4.52.0 in the docs, it appears to resolve to 4.51.4 in the examples(!))

Screenshots
Screenshot from attached example:
ids-tree-addnode-returns-incorrect-li

Platform

  • OS Version: Windows 10
  • Browser Name: chrome
  • Browser Version: 91.0.4472.106 (Official Build) (64-bit) (cohort: Stable)
@tmcconechy tmcconechy added [2] Velocity rating (Fibonacci) type: bug 🐛 labels Jun 18, 2021
@ericangeles ericangeles added this to To do in Enterprise 4.56.x (Sept 2021) Sprint via automation Sep 30, 2021
@ericangeles ericangeles moved this from To do to Pending Review in Enterprise 4.56.x (Sept 2021) Sprint Sep 30, 2021
@tmcconechy tmcconechy moved this from Pending Review to Ready for QA (beta) in Enterprise 4.56.x (Sept 2021) Sprint Oct 4, 2021
@CindyMercadoReyes
Copy link
Collaborator

This issue is now resolved.

@CindyMercadoReyes CindyMercadoReyes moved this from Ready for QA (beta) to Done in Enterprise 4.56.x (Sept 2021) Sprint Oct 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 [2] Velocity rating (Fibonacci)
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

4 participants