Shutting down a filtered v-treeview node becomes sluggish when operating with a large number of items

My v-treeview has a node with approximately 2000 children, and I am in need of applying a filter to it. However, the current issue is that opening the node takes around 3 seconds, while closing it takes about 15 seconds, which is completely unacceptable.

When the filter is not applied, both opening and closing the node are nearly instantaneous, and it seems that closing the node does not trigger the filter function again.

This problem can easily be reproduced using the Searching a Directory example as a reference.

You can find the CodePen demonstration here: https://codepen.io/james-hudson3010/pen/JjXYgZj

<div id="app">
  <v-app id="inspire">
    <v-card
      class="mx-auto"
      max-width="500"
    >
      <v-sheet class="pa-4 primary lighten-2">
        <v-text-field
          v-model="search"
          label="Search Company Directory"
          dark
          flat
          solo-inverted
          hide-details
          clearable
          clear-icon="mdi-close-circle-outline"
        ></v-text-field>
        <v-checkbox
          v-model="caseSensitive"
          dark
          hide-details
          label="Case sensitive search"
        ></v-checkbox>
      </v-sheet>
      <v-card-text>
        <v-treeview
          :items="items"
          :search="search"
          :filter="filter"
          :open.sync="open"
        >
        </v-treeview>
      </v-card-text>
    </v-card>
  </v-app>
</div>


new Vue({
  el: '#app',
  vuetify: new Vuetify(),
  data: () => ({
    items: [
      {
        id: 1,
        name: 'Vuetify Human Resources',
        children: [
          {
            name: 'Core team',
            children: [
              { id: 2, name: 'John-0' },
{ id: 3, name: 'John-1' },
{ id: 4, name: 'John-2' },
{ id: 5, name: 'John-3' },
{ id: 6, name: 'John-4' },
{ id: 7, name: 'John-5' },

// 
// Some items removed due to length
//

{ id: 2000, name: 'John-1998' },
{ id: 2001, name: 'John-1999' },
            ],
          }
        ],
      },
    ],
    open: [1, 2],
    search: null,
    caseSensitive: false,
  }),
  computed: {
    filter () {
      return this.caseSensitive
        ? (item, search, textKey) => item[textKey].indexOf(search) > -1
        : undefined
    },
  },
})

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the best way to include the "onChange" function in a component that does not natively support this prop?

After finding a useful code snippet on this page to switch languages, I attempted to enhance it by incorporating material UI components for better styling. However, whenever I change the language, it redirects me back to the home page because the MenuList ...

Update the 'checked' attribute of a radio button when the form is submitted

How do I dynamically change the content of an HTML table based on which radio button a user selects using jQuery? For example, when the page loads, I want the United Kingdom radio button to be checked and the table content to display as 'blue'. I ...

Access to the Vue API token in Flask without permission was detected

Here is the content of my file: from flask import render_template, redirect, url_for, g from flask_httpauth import HTTPTokenAuth from app import app, db from .models import User import json auth = HTTPTokenAuth(scheme='Token') tokens = { & ...

Javascript code generated by PHP is failing to run

When you select an option from the dropdown below: <select id='dropdown' name='dropdown' onchange='showChart(this.value)'> <option value="1">Foo</value> <option value="2">Bar</value> </select& ...

Determining if the device orientation matches the given coordinates through a logical process

Exploring the capabilities of browser API's related to geolocation and device orientation. I'm wondering, if I have information on someone's orientation (like a compass angle from 0 to 360 degrees), is it feasible to determine if they are f ...

When using Node.js with Mongoose, you will receive a single object value instead of multiple values in an array

data=[{ locId: '332wn', locadetails: [ { loc: 'ny', status: true }, { loc: 'ca', status: null ...

Failure to assign unique ids to Vue components

In my single page app, I have a component that renders gauges using the highcharts library to display sensor information from different rooms in my house. The number of gauges varies depending on the room and the data being displayed. All the room routes a ...

Utilizing Kendo MVVM to Bind to an Self-Executing Anonymous Module Function

Currently, I am experimenting with the Kendo UI MVVM framework and attempting to bind it to a self-executing anonymous modular function. The situation is a bit complex, as the functionality is only somewhat working. Although the module is being updated whe ...

Having trouble transferring file object from reactjs to nodejs

Hey there! I am relatively new to nodejs and React, and currently, I'm working on a project that involves sending a selected file from the front end (React) to the back end (Node). The goal is to upload the file and convert it into a JSON object. Howe ...

How to extract a variable from a mongoose find method in a Node.js application

Within my Node.js program, I utilize my Mongoose database to query for a specific value in a collection, of which there is only one value present. var myValueX; myCollection.find(function(err, post) { if (err) { console.log('Error ...

Transform a button into an AngularJS directive

Is there a way to create a custom directive in HTML to represent a button? For example: <buy-button></buy-button> Here is the code that I would like to change: <md-button class="md-cornered" ng-disabled="0>=gains" ...

Embedding a thread in an HTML document (Difficult task)

I'm currently working on a method to achieve the following task: Embedding a specific string (such as "TEST") into the content of an HTML page, after every certain number of words (let's say 10). The challenge here is ensuring that the word count ...

Running concurrent codes is not possible in Node.js serialport

I am attempting to stream data from the MSP432 xds110 in order to display it on my website in real-time. To achieve this, I have opted to utilize the node.js serialport library for data retrieval. You can find more information about serialport here: In m ...

Capturing Key Events on Canvas in Vue.js

When using Vue 2.5, I encountered an issue with a canvas element that has a key event listener: <template> <canvas v-on:keyup.esc="abortThing"></canvas> </template> <script> export default { methods: { abortTh ...

Is it possible to toggle the status of an item in JSON based on a counter value

Here is the JSON data I have: "questions": { "id": 1, "question": "Select one color", "answers": [ {"id": 1, "answer" : "Green", "isSelected" : false}, {"id": 2, "answer": "Red", "isSelected" : false}, ...

Add a font awesome icon dynamically using JavaScript

I'm currently working on a navigation bar in JavaScript that displays the titles of various links. However, I would like to enhance it by adding small icons next to the text. Can anyone guide me on how to integrate Font Awesome icons into my JavaScrip ...

Angular 8: How to Filter an Array of Objects Using Multiple Conditions

I am faced with the following scenario where I need to filter an array of objects based on lineId, subFamily, and status. My current code successfully filters based on lineId, but now I also need to include a condition for subFamilyId. I have two specifi ...

Experiencing issues with overflowing columns in JQuery Datatables

I am currently facing an issue with my datatable where I need it to have a specific width while also displaying all its columns. The problem I am encountering can be summarized as follows: I came across solutions like Datatables Width Overflow For A ...

Troubleshooting: Magento checkout page keeps scrolling to the top

We are experiencing an issue where, during the one page checkout process, the next step is not automatically scrolling to the top of the page when it loads. After a user fills out all their billing information and clicks continue, the next step appears ha ...

Tips for emphasizing a cube face when it is hovered over in THREE.js

I'm currently using a raycaster to determine the face of a cube and then apply color to it following this method: const colorAttribute = intersected.object.geometry.getAttribute('color'); colorAttribute.setXYZ(face.a, color.r, color.g, color ...