Comments (11)
@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.
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.
Released in https://github.com/dgreene1/react-accessible-treeview/releases/tag/v2.6.0
from react-accessible-treeview.
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.
@hnnweb would you consider submitting a PR now that I’ve reopened the issue?
from react-accessible-treeview.
The original one from @sandro768 should do it...
from react-accessible-treeview.
@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.
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):
The code:
from react-accessible-treeview.
@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.
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.
@hnnweb Are you loading data asynchronously?
from react-accessible-treeview.
Related Issues (20)
- Expansion of the `metadata` object HOT 8
- updating selectedIds fires onNodeSelect HOT 3
- Bug with node deletion when controlling node expansion HOT 10
- Updating controlled selectedIds steals focus and gives it to the tree HOT 12
- Option to turn off keyboard navigation HOT 4
- How to create a node HOT 1
- How can I access "treeState" out of nodeRenderer function as a globally? HOT 2
- Allow us to override the list component HOT 1
- Do not lock issues HOT 2
- onSelect & onNodeSelect's element is not the element that was selected HOT 3
- Focus on tree element after reload HOT 11
- Support drag and drop between directories HOT 3
- possibility of animation? HOT 1
- Error "Cannot read properties of undefined (reading 'id')" with Asynchronous Loading after Re-rendering compoent HOT 3
- Allow overriding of "isBranch" state for nodes HOT 4
- Question: Open new node/closing the other nodes HOT 2
- `IFlatMetadata`: allow `boolean` values HOT 1
- Uncaught SyntaxError: The requested module '/myproject/node_modules/components/node_modules/classnames/index.js?v=48a52094' does not provide an export named 'default' HOT 1
- Feature request: Open new node/closing the other nodes HOT 2
- Cannot find module 'classnames' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-accessible-treeview.