Skip to content
New issue

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

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

Already on GitHub? # to your account

Add an ActionItem for NavigationPane #104

Closed
WinXaito opened this issue Nov 25, 2021 · 3 comments
Closed

Add an ActionItem for NavigationPane #104

WinXaito opened this issue Nov 25, 2021 · 3 comments

Comments

@WinXaito
Copy link
Collaborator

Is there a way to perform an action from the NavigationPane (for example a "logout" action)?

If there is no possibility to do this, would it be possible to have an "ActionItem" in addition to the "PaneItem" allowing to execute a simple action when clicking on the button without having to change the pane.

image

@bdlukaa
Copy link
Owner

bdlukaa commented Nov 25, 2021

You can use the onChanged to perform it:

onChanged: (i) {
  if (i == 3) // where 3 is your item index
      ; // perform your action
  else
      setState(() => index = i);
},

@WinXaito
Copy link
Collaborator Author

Yup

The only disadvantage is that if we do this on an item in the middle of the list, we are forced to have a "fake" widget in the list of items so we don't have to do index calculations.

But it's ok for me with this solution. Thanks

@bdlukaa bdlukaa reopened this Nov 25, 2021
@bdlukaa
Copy link
Owner

bdlukaa commented Nov 25, 2021

Reopening as a valid request!

WinXaito added a commit to WinXaito/fluent_ui that referenced this issue Nov 27, 2021
@WinXaito WinXaito mentioned this issue Nov 27, 2021
6 tasks
dev-hann added a commit to dev-hann/fluent_ui that referenced this issue Sep 18, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants