-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
@item-toggle is called twice #67
Comments
I am experiencing this as well.. |
Probably related. If you are using async data and expand a node the load data call is called twice as well. |
experiencing same issue, made an ugly workaround where i would ignore the second toggle with a timeout. can anyone suggest a fix? |
What I am doing is
|
I think this is a bug. in |
The underlying issue here is even worse in my case, because it is causing my (expensive) Is there a fix or workaround that would work? Following is a simple example to reproduce the issue:
which produces the following console output...
|
@sburr see what I posted above as a workaround. You will have to debounce the call to load your children so it only happens once. Dirty, but effective. |
Thank you. I did read that but had missed a nuance in the way that underscore's debounce method works in an effort to avoid yet another dependency. |
This repo may interest you if you don't want to import more libs
https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore
…On Fri, Jan 4, 2019, 2:44 PM Steven Burr ***@***.*** wrote:
Thank you. I did read that but had missed a nuance in the way that
underscore's debounce method works in an effort to avoid yet another
dependency.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#67 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAp45bEdCQkR8PpHCAgoKDoXJeuVjMQnks5u_680gaJpZM4VzeKO>
.
|
I'm experiences this also. Annoying issue.. |
Some more details for a quick workaround in tree.vue using TypeScript library ts-debounce:
|
how to call method or variable in "debouncedItemToggle" sir? can you give an example? I'm new to vue-jstree |
You can pass in 'this' to the debouncedItemToggle |
I have modified this method,delete this code" ,this.onItemToggle(this,this.model)",and it worked ;I don't know whether there will be other side effects. |
@renqWork good job man 🥳 |
I added @item-toggle="ItemToggle"
and created the function:
ItemToggle( ){ ... }
The function ItemToggle is called twice, why?
The text was updated successfully, but these errors were encountered: