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

v1.5.0 Bug when clicking on an element #100

Open
qhantom opened this issue Jan 14, 2021 · 2 comments
Open

v1.5.0 Bug when clicking on an element #100

qhantom opened this issue Jan 14, 2021 · 2 comments

Comments

@qhantom
Copy link

qhantom commented Jan 14, 2021

I use vue-tree-list in production and noticed that it does not append new children of a parent. Basically, this is the code that does it for me:

      const onLoadChildTreeElement = async (parentElement: TreeElementNode) => {
        const resChildTreeElement = await treeApi.getChildTreeElement(parentElement.id!)
        parentElement.children = resChildTreeElement.map((children) => {
          return new TreeNode({ ...children, addLeafNodeDisabled: true, parent: parentElement })
        })
      }

Nothing wrong with the API call but which the logic of the package it guess. I downgraded to version 1.4.6 and it works as it should.

@ParadeTo
Copy link
Owner

Could you give more info, I cannot understand you

@qhantom
Copy link
Author

qhantom commented Jan 15, 2021

Well, the point is, that after the update the parentElement.children property cannot be reflected on the DOM. I've got a button with a click-handler and pass onLoadChildTreeElement as a callback. The parameter parentElement gets passesd with the invokation of onLoadChildTreeElement after I click on a tree element on the DOM. Basically, it should then attach the new childrens to the children property. But that does not happen for some reason.

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