vue-treeselect icon indicating copy to clipboard operation
vue-treeselect copied to clipboard

TURN OFF console.log of multiple parents error

Open HenryAveMedi opened this issue 4 years ago • 10 comments

(I saw there's a question related to this, but it's closed, wrote there but got no response)

I have a project where nodes have multiple parents and need to be shown in tree in the different positions, if repeated it works actually properly, it selects or deselects the nodes in all instances (as it should). In my project is not an error/warning, can i deactivated the console.log somehow so i stop getting these warnings please?

[Vue-Treeselect Warning] Detected duplicate presence of node

And thank you for this great component @riophae

HenryAveMedi avatar Aug 26 '19 09:08 HenryAveMedi

You may want to use the normalizer feature to change the ID. For example, you can use lodash's uniqueId to get a unique ID based on the actual ID.

normalizer(node) {
    return {
        id: _.uniqueId(node.id),
        label: node.label,
        children: node.children
   }
}

innocenzi avatar Sep 17 '19 10:09 innocenzi

You may want to use the normalizer feature to change the ID. For example, you can use lodash's uniqueId to get a unique ID based on the actual ID.

normalizer(node) {
    return {
        id: _.uniqueId(node.id),
        label: node.label,
        children: node.children
   }
}

thanks for your comment, this answer would change the behavior. I DO NEED multiple parents for children, and if the child is activated in one place of the tree, IT SHOULD BE ACTIVATED in all instances. it is behaving like that already, which means, THE FUNCTIONALITY IS CORRECT for what I need. giving the items unique IDs would change this behavior and the child would only be activated in the instance in which is clicked

I just need to get rid of the console log warnings

HenryAveMedi avatar Oct 04 '19 18:10 HenryAveMedi

Do you think it would be a nice feature to set an option for not showing the bug/warning messages?

HenryAveMedi avatar Oct 06 '19 22:10 HenryAveMedi

I also require to have the same item more than once in different "groups". The functionality works by using the same ID, but errors are shown.

Can we at least switch to console.warn instead of console.error?

glumb avatar Dec 13 '19 18:12 glumb

I have the same issue. Any way to get rid of it?

julianflapper avatar May 27 '20 15:05 julianflapper

+1 same issue. any update to add an option to use same id in different groups?

CodeArtisT75 avatar Jul 05 '20 08:07 CodeArtisT75

+1 same issue.

GTCrais avatar Feb 11 '21 12:02 GTCrais

Guys, this package is abandoned - the last update was on Nov 9, 2019.

TitanFighter avatar Feb 11 '21 22:02 TitanFighter

any update on this issue? how to ignore this error

marzz17 avatar Jan 26 '23 14:01 marzz17

UP

darakanoit avatar Jan 31 '23 08:01 darakanoit