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.

[Feature Request] Treeview - force at least one node active

See original GitHub issue

Problem to solve

I would like to force the user to have at least one treeview node active. User should not be able to deactivate active node. For v-list-group we have mandatory prop which does exactly this.

Proposed solution

Add new prop mandatory-active for treeview. When this prop is true, at least one treeview node must be active -> similar behavior to mandatory prop in v-list-group.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:4
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
mDemianchukcommented, Oct 7, 2021

+1

In one of my projects, I use v-treeview for site navigation, where every leaf is a link to a component. I can get the active leaf using @update:active which produces an array of active leaves and then I grab the first one. However, if I click on the same leaf again, it deactivates it, so the resulting array of @update:active is empty. Of course, I can handle a case like that, but it still messes up my css, as that leaf element drops its v-treeview-node--active class.

A simple case like that requires lots of manual work, so having an out-of-the-box feature like this would be very helpful!

2reactions
Mikilll94commented, Dec 24, 2020

@escapedcat This is not a solution. I want to force the user to have at least one treeview node active. Your proposition is not related to active state and it does not work. Error message is not a solution.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TreeView Class (System.Windows.Forms) | Microsoft Learn
Displays a hierarchical collection of labeled items, each represented by a TreeNode.
Read more >
Java TreeView User's Manual - SourceForge
Any operation which selects genes in one view, either due to genome ordering, hierarchical clustering, or per-gene statistics, selects the genes in all...
Read more >
Tree View | APG | WAI - W3C
A tree view widget presents a hierarchical list. Any item in the hierarchy may have child items, and items that have children may...
Read more >
Tree View Tutorial - GTK Documentation
A tree view column needs to contain at least one cell renderer, but can contain multiple cell renderers. For example, if one wanted...
Read more >
Tree view | Interface guidelines - Primer Design System
If a user expands nested parent nodes and then collapses a parent node higher in the hierarchy, persist the expanded parent nodes lower...
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