ic-ui-kit icon indicating copy to clipboard operation
ic-ui-kit copied to clipboard

[ic-tree-item]: Emit the expanded state of the tree item.

Open jd239 opened this issue 8 months ago โ€ข 1 comments

Summary

It would be useful to have the expanded state of the ic-tree-item emitted so a particular action and be performed if the tree item is open or not.

๐Ÿ’ฌ Description

It looks like the expanded state of an tree item is already available, however, it is not being exposed via the IcTreeSelected event or in it's own event handler.

๐Ÿ’ฐ Use value

It would be good to expose this to users so that they can perform an action based on the tree item's expanded state.

๐Ÿ“ Acceptance Criteria

If relevant, describe in full detail the different interactions and edge cases that the component or patterns needs to fulfil.

Given that the tree view component is initially loaded When a tree item is clicked
Then an event will be emitted which includes the expanded state of the tree item

Given that a tree item is expanded When the user clicks on the tree item Then the tree item should emit isExpanded: false as the tree item has just collapsed

Given that a tree item is closed When the user click on the tree item Then the tree item should emit isExpanded: true as the tree item has just been expanded

โœ Designs

N/A

##โ€ฏ๐Ÿงพ Guidance N/A

Additional info

Tell us anything else useful to help us understand your suggestion.

jd239 avatar May 13 '25 13:05 jd239

Can I try to fix this?

evenstensberg avatar May 14 '25 09:05 evenstensberg

@evenstensberg, please do if you have time to!

MI6-255 avatar May 21 '25 08:05 MI6-255

We agreed to make the expanded prop mutable and introduce an event

MI6-255 avatar May 22 '25 08:05 MI6-255