Code Monkey home page Code Monkey logo

Comments (11)

hnnweb avatar hnnweb commented on May 17, 2024 1

@mellis481 Both.
We are displaying a file tree ( As this example https://dgreene1.github.io/react-accessible-treeview/docs/examples-DirectoryTree ).
The isBranch is used to display it as a folder in case it is empty ie. empty children,

Data is loaded asynchronously before the component is loaded but is also populated as data is changed ( removed, added, changed or moved )

from react-accessible-treeview.

dgreene1 avatar dgreene1 commented on May 17, 2024

Closing since this is a duplicate of #86. Once #117 is merged you’ll be able to set that prop on the metadata object.

from react-accessible-treeview.

dgreene1 avatar dgreene1 commented on May 17, 2024

Released in https://github.com/dgreene1/react-accessible-treeview/releases/tag/v2.6.0

from react-accessible-treeview.

hnnweb avatar hnnweb commented on May 17, 2024

This should be opened again since it doesn't solve the problem.

What I can see #117 preserves the metadata. But isBranch is not part of metadata according to the API Reference.

I'm running 2.8.0 and flattenTree removes isBranch from the JSON object.

from react-accessible-treeview.

dgreene1 avatar dgreene1 commented on May 17, 2024

@hnnweb would you consider submitting a PR now that I’ve reopened the issue?

from react-accessible-treeview.

hnnweb avatar hnnweb commented on May 17, 2024

The original one from @sandro768 should do it...

from react-accessible-treeview.

dgreene1 avatar dgreene1 commented on May 17, 2024

@hnnweb I approved it and merged it, but I’m not sure when the team will be able to release it. Hold tight while I get an answer. Check the release notes since I might forget to update you here.

from react-accessible-treeview.

kpustakhod avatar kpustakhod commented on May 17, 2024

Hey @dgreene1 i see the potential issue in #123. Now tree can display the branch node without any children, please see screenshots below.
The view ('Onion' is set as branch but with children: [] or without children property):
Screenshot 2023-09-14 at 09 10 48
The code:
Screenshot 2023-09-14 at 09 10 43
Screenshot 2023-09-14 at 09 12 05

from react-accessible-treeview.

hnnweb avatar hnnweb commented on May 17, 2024

@kpustakhod That is the purpose.
If you build the native tree ( with id and parent ) it works like this.

flattenTree didn't take isBranch into the object.

Please see the documentation:
https://dgreene1.github.io/react-accessible-treeview/docs/api#data

from react-accessible-treeview.

kpustakhod avatar kpustakhod commented on May 17, 2024

flattenTree didn't take isBranch into the object because it is used not only for async functionality. I try to highlight that after #123 those users who use flattenTree and don't load data asyncroniously will possibly get a broken tree view if somehow they've set isBranch prop in object that is passed to flattenTree.
Additionally i would expect some tests are added insrc/__tests__/FlattenTree.test.ts and async examples in storybook are also updated.

from react-accessible-treeview.

mellis481 avatar mellis481 commented on May 17, 2024

@hnnweb Are you loading data asynchronously?

from react-accessible-treeview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.