You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm assuming that a reasonable way to do this is to build a nested structure of md-list, and md-list-item elements with md-icons showing the current expanded/collapsed state, and then add some event handling to toggle these open and closed.
This is what I've got so far. See below. Seems to work ok.
I'll need to find a less manual way to do the indentation. I could make a wrapper component which will take a md-list in a slot and then tweak each of the child element styles to get the indentation right.
Curious if anyone has already done this, or thought about this, and could provide some advice.
Edit: hmm it looks like nesting md-list doesn't work with keyboard navigation. Should I group the children in a plain div instead?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'd like to create a tree view. Any advice on a good approach?
Here's an example of the kind of tree view I'm thinking about:
https://material.angular.io/components/tree/overview#nested-tree
I'm assuming that a reasonable way to do this is to build a nested structure of
md-list
, andmd-list-item
elements withmd-icon
s showing the current expanded/collapsed state, and then add some event handling to toggle these open and closed.This is what I've got so far. See below. Seems to work ok.
I'll need to find a less manual way to do the indentation. I could make a wrapper component which will take a
md-list
in a slot and then tweak each of the child element styles to get the indentation right.Curious if anyone has already done this, or thought about this, and could provide some advice.
Edit: hmm it looks like nesting
md-list
doesn't work with keyboard navigation. Should I group the children in a plaindiv
instead?Cheers!
Beta Was this translation helpful? Give feedback.
All reactions