question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

getTickedNodes () of QTree does not return all ticked nodes

See original GitHub issue

Describe 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:

  1. Open console. Click any checkbox.
  2. You should see the arrays returned in the console. The length is always correct length - 1.
  3. 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:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
rstoenescucommented, May 17, 2021

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.

1. Component emits "update:ticked" which tells Vue "hey, this needs updating"
2. This is where you also run the update:ticked handler.
3. Vue updates it and supplies the component with the new value.
4. Component updates the value. Now getTickedNodes() can return the good result.
1reaction
rstoenescucommented, May 16, 2021

Use nextTick() until I can investigate this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

q-tree - issues with ticked nodes - Quasar forum
I need 'leaf' tick strategy behavior, with the following… (0) When the user selects the node “0” with no other nodes selected I...
Read more >
How to override quasar QTree component in a single file ...
I would like to override Quasar's QTree in a single file component from the code pen. I have created the component below but...
Read more >
Tree | Quasar Framework
Ticked nodes are independent of parent or children tick state. You can apply a global tick strategy for a QTree and locally change...
Read more >
quasar - UNPKG
quasar/src/components/tree/QTree.json ; 200, "ticked": { ; 201, "type": "Boolean", ; 202, "desc": "Is node ticked? Can directly be assigned new Boolean value which ......
Read more >
Tree: Syncing node properties - Quasar Playground - CodePen
https://quasar.dev/vue-components/tree#Example--Syncing-node-properties ... <div class="text-h6">Selected Data</div>. 19. <div>. 20. {{ selectedObject }}.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found