Topic: Tree view Filter omits elements at lowest level in tree

Espen Rønning priority asked 3 days ago


Expected behavior Filter should open all nodes with elements containing the search value.

Actual behavior If the search value is found in an element at the trees lowest level its node is not shown.

Resources (screenshots, code snippets etc.) This error has been introduced some time after 6.1.0. I think its related to these code changes in the filter() function:

      const isExpanded = Manipulator.hasClass(ul, CLASSNAME_SHOW);
      -> New: const hasChildren = SelectorEngine.children(node, 'ul').length > 0;

      if (!isExpanded -> New: && hasChildren) {
        const id = ul.getAttribute('id');

        this.expand(id);
      }

You can see the error by running the code snippet in the tree view documentation: https://mdbootstrap.com/docs/standard/plugins/tree-view/#section-filter

If you search for "fourth" the nodes "Third-one" and "Third-three" should open, but they don't.


Grzegorz Bujański staff answered 2 days ago


Thanks for reporting. We're working on it.



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 7.3.2
  • Device: PC
  • Browser: Chrome
  • OS: Windows 11
  • Provided sample code: No
  • Provided link: Yes