-
Notifications
You must be signed in to change notification settings - Fork 94
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
Vuex not working with editmode, keyboardNavigation, deletion options #77
Comments
Yeah, I have the similar behavior. Here's fiddle for convinience |
@amsik do you have time to investigate the issue with edit mode with vuex? |
I will try to find the time on the weekends |
@amsik any chance you have an update on this? The editmode is most important. |
New Year's miracle did not happen :'( |
Hi people. Have same issue though magically deletion works! |
Basing on my expirience and on this fiddle - html is being rebuilt on every action. That means that on startEditing - input IS rendered but on the next moment the whole tree is rebuilt flushing any changes. This is very clear if you take quoted fiddle and set breakpoint on div.tree-scope (with chrome devtools) to pause on node removal (and on subtree modification just in case) - you'll see rendered input which is going to disappear on resume because of total tree refresh. This is an amazing component - almost perfect treeview for Vue. Can we build it better together? |
Futher investigations show that when usin Vuex TreeMixin.js subscribes component to Store actions and updating whole DOM on every emit of LIQUOR_NOISE event Store.subscribe((action, state) => {
So when you click on node - it becomes "selected", event emitted and whole tree dispatched to Store. And on the next moment Store subscriber catching changes in Store and sets model to DOM - refreshing it totally. This leads to multiple mutations at a time. It triggers twice or even three times sometimes. |
Small workaround. Works only in my case - tree is rendered inside slideout panel which can be closed by clicking button. let treeJSON = this.$refs.treeStructure.toJSON() where treeStructure is ref="treeStructure" on component. Now user can manipulate tree in opened panel, dnd, navigate with keyboard, edit nodes and save them. And when panel is closed - tree dumped to store. |
А с этим вопросом так и не решилось? |
This approach seems to work. Instead of having a dispatcher in the options: One can add the dispatch to the editing:stop event:
|
Any updates on this one? |
Seems there is a bug with "node.startEditing" and keyboardNavigation and deletion options when tied to vuex. Everything works without vuex but when tied to treedata from store the edit does't work. Or have i configured incorrectly?
This is the tree component
This is the edit function in the methods
The text was updated successfully, but these errors were encountered: