Closed SterlingButters closed 1 year ago
Hi @SterlingButters
I'm afraid I can't see a good way to expose the focused state of those items. In particular with a nested setup like you have, there wouldn't really be a way to get the components to communicate with each other...
What are you trying to do with the focused state? Seems to me that you are pretty close with having the id of the last clicked item?
@tcbegley
can't see a good way to expose the focused state
Do you mean in general or for my particular nested setup? If the latter, I don’t need the focused state to “communicate” with the other accordion items (even if I did need to, could I not use the ‘ALL’ pattern-matching callback schema - something similar to what’s implemented for ‘active_item’ property).
Yes, I can get the last focused item no problem. I would like to access the “focused_item” property to “write” it, not “read” it. See, my table of contents nested accordion is quite long - so I would like to implement a searchable drop down that contains the contents. Based on the dropdown component ‘value’ property, I would like to set the focused item in the nested setup. I have already implemented the ability to collapse all items of non-interest using the drop down but I can eliminate the extra step of having to click the accordion item if the focused item property is exposed.
Thanks!
Greetings,
I have created a nested accordion for navigating a sort of "Table of Contents":
Notice I have changed the styling for the Accordion Item that was last pressed - this is only through the css:
.accordion-button:focus{...color:white;background-color:rgba(25, 0, 255,.7)}
Using the pattern matching callbacks feature I am able to return the "last pressed" AccordionItem:
The "active_item" property only depicts which menu items are not collapsed, not the most recently activated (focused) menu item. As my feature request, I would like to be able to expose the focused menu item that corresponds to the aforementioned css styling as a component property. Not sure what the best way to do this is or if there is a temporary "hack" I can do. Thanks in advance!