Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the AppUI's toolbar support showing/hiding a ToolbarItem with isHidden property set #314

Closed
ezmobivietnam opened this issue May 10, 2023 · 2 comments · Fixed by #434
Assignees

Comments

@ezmobivietnam
Copy link

Is your feature request related to a problem? Please describe.

We would like to have a toolbar that contains the items which are visible/hidden based on a specific condition (like the image below). We use the AppUI's Toolbar to make the toolbar but it seems that it still does not support showing/hiding a ToolbarItem with isHidden property set yet.
Screenshot 2023-05-10 at 4 10 12 PM

Note: We have tried to use the ToolbarComposer but it does not meet our use case because it keeps trying to load/display the toolbar items from the UI providers only.

Describe the solution you'd like
Make the Toolbar works similarly to the ToolbarComposer.

Describe alternatives you've considered
We have copied some pieces of code which manage the visibility of the toolbar items from the ToolbarComposer (e.g. copied the hook useToolbarItemSyncEffect, and use some internal APIs like ToolbarItemsChangedArgs, ToolbarItemsManager...) and used them in our code base. It works but we don't think it is a good solution though.

@raplemie
Copy link
Contributor

@GerardasB despite the other work that you'll make regarding #85 I'll take a look into this one, currently, the Conditional** is handled by ToolbarItemsManager, and not in the Toolbar or ToolbarWithOverflow, I think those should handle it as well, so I'll refactor to enable those, which should provide the solution to this issue.

@raplemie
Copy link
Contributor

Hi @ezmobivietnam , a fix for this have been provided in 4.4.0 which was released today, the Toolbar component will now correctly handle Conditional props on toolbar items without the need of the ToolbarComposer.

Let us know if this address your issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants