getTickedNodes () of QTree does not return all ticked nodes
See original GitHub issueDescribe the bug
getTickedNodes () of QTree does not return all ticked nodes when it is called in @update:ticked
or when “watching” ticked
array. It always returns one item less than the true item list. However, it returns correct result when it is called from somewhere else, e.g. by clicking a QBtn.
The following Codepen is a fork of the official document of QTree.
Codepen/jsFiddle/Codesandbox (required) https://codepen.io/muveex/pen/NWpNEZQ?editors=101
To Reproduce Steps to reproduce the behavior:
- Open console. Click any checkbox.
- You should see the arrays returned in the console. The length is always correct length - 1.
- Click getTickedNodes QBtn. You should see it returns correct length, just as I described above.
Expected behavior getTickedNodes () should always return correct number of items.
Platform (please complete the following information): Quasar Version: v1.15.14 @quasar/app Version: v2.2.6 Quasar mode:
- SPA
- SSR
- PWA
- Electron
- Cordova
- Capacitor
- BEX
Tested on:
- SPA
- SSR
- PWA
- Electron
- Cordova
- Capacitor
- BEX
OS: Windows 10 Node: 14 NPM: 7 Browsers: Chrome and Firefox latest
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
Top GitHub Comments
Again, it’s not an issue. It’s how Vue works. You are requesting information that hasn’t been updated yet. The
@update:ticked
is used by Vue itself to update it.Use nextTick() until I can investigate this.