Skip to content
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

[Feature Request] Treeview search #5621

Closed
ahmadnchami opened this issue Nov 15, 2018 · 3 comments
Closed

[Feature Request] Treeview search #5621

ahmadnchami opened this issue Nov 15, 2018 · 3 comments
Assignees
Labels
T: feature A new feature

Comments

@ahmadnchami
Copy link

Versions and Environment

Vuetify: 1.3.8
Vue: 2.5.17
Browsers: Chrome 70.0.3538.102
OS: Windows 10

Steps to reproduce

Check any node and search for another node

Expected Behavior

The selected items should not be changed

Actual Behavior

The selected items will removed if not found in the search results

Reproduction Link

https://codepen.io/anec/pen/YRVged?&editors=101

@cb109
Copy link
Contributor

cb109 commented Nov 15, 2018

To clarify: While the nodes retain their "selected" status visually, their keys are removed from the selected v-model. So visual representation and actual selection are out of sync.

@nekosaur nekosaur self-assigned this Nov 15, 2018
@nekosaur nekosaur added the pending review The issue is still pending disposition label Nov 15, 2018
@nekosaur
Copy link
Member

This is a tricky one. Because the expected behavior that you describe is not what will happen when this bug is fixed. Since the filtering is happening outside of the component, it has no way of knowing that previously selected items that are filtered out are supposed to 'stay' in the selected set, and return when you reset the filter.

All it knows is that it is given a new set of items, and it creates the tree from that, resetting state in the process.

I do get what you're trying to achieve, but I don't see an immediate easy solution, other than internalizing a filter function in the component..

@ahmadnchami
Copy link
Author

I might have a solution in mind, not sure if this helps or not.
I suggest to have a scoped slot where a node can be hidden (not removed) based on on an item property. However, this does create a problem, what if the node hidden is a parent node, in this case the node children should be hidden as well.
Just an idea I suppose.

@nekosaur nekosaur added T: bug Functionality that does not work as intended/expected and removed pending review The issue is still pending disposition labels Nov 16, 2018
@MajesticPotatoe MajesticPotatoe changed the title Treeview search [Bug Report] Treeview search Dec 7, 2018
@nekosaur nekosaur changed the title [Bug Report] Treeview search [Feature Request] Treeview search Jan 8, 2019
@nekosaur nekosaur added T: feature A new feature and removed T: bug Functionality that does not work as intended/expected labels Jan 8, 2019
@KaelWD KaelWD closed this as completed in 75bbcc5 Feb 5, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Feb 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T: feature A new feature
Projects
None yet
Development

No branches or pull requests

3 participants