Closed a-gagnon closed 1 week ago
ToolbarGroupItem
API was intentionally designed to disallow custom items (this was related to challenges in old/outdated designs) - that's why group items can only contain other group or action items. I think we could revisit this with our new toolbar implementation, but that would fall under new feature request instead.
Your approach of filtering the custom items out seems correct to me.
Describe the bug
Hey, I’m working on integrating our latest civil packages using the newer
UiItemsProvider
interfaces within pineapple.What I'm trying to do is collect the output of multiple
UiItemsProvider.getToolbarItems()
and return that under a single group item (snippet below). The compiler is yelling at me because whatgetToolbarItems()
return isToolbarItem[]
(which includesToolbarCustomItem
), and theToolbarGroupItem
I’m trying to create only acceptsToolbarActionItem | ToolbarGroupItem
.I was wondering if this is just an oversight, or it's by design? It seems to make composition a bit harder than it should be. I can use the
isToolbarCustomItem
and filter those out entirely, but I wanted to ask first. In this case, I'm the author of both the UiItemsProvider and the code that consumes it, so I know there is no custom item...Snippet of code:
Thanks! Alex
To Reproduce
No response
Expected Behavior
No response
Screenshots
No response
Desktop (please complete the applicable information)
No response
Additional context
No response