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

Context/right-click menu #2157

Open
GerardasB opened this issue Jul 23, 2024 · 5 comments
Open

Context/right-click menu #2157

GerardasB opened this issue Jul 23, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@GerardasB
Copy link

GerardasB commented Jul 23, 2024

Feature

AppUI team is deprecating ContextMenu from @itwin/core-react storybook
This component was regularly used to render an action list and can be usually replaced by an iTwinUI DropdownMenu i.e. saved views widget:
Screenshot 2024-07-23 at 15 05 14

Another use-case is when the menu is used as a contextual/right-click menu. Then it must be positioned without an explicitly visible target (i.e. following cursor), which DropdownMenu currently doesn't support out-of-the-box.
For this use case, we had a separate component GlobalContextMenu.

Examples

Here's an example of how it could work with current iTwinUI components: stackblitz.
Feature-wise the context menu is very similar to the DropdownMenu since it usually contains actions and can be nested.

@GerardasB GerardasB added the enhancement New feature or request label Jul 23, 2024
@GerardasB GerardasB changed the title Context/righ-click menu Context/right-click menu Jul 23, 2024
@mayank99
Copy link
Contributor

Hey @GerardasB, can you clarify the first use-case? The menu in your screenshot looks like a regular DropdownMenu, since it is triggered by a regular button.

@mayank99 mayank99 added the needs more info This issue is waiting on more info from author label Jul 25, 2024
@GerardasB
Copy link
Author

Hey @GerardasB, can you clarify the first use-case? The menu in your screenshot looks like a regular DropdownMenu, since it is triggered by a regular button.

Yes, that's just one of the use cases of how our current ContextMenu component was used and it should be replaced by iTwinUI DropdownMenu. We should focus on addressing the use case when there is no trigger.

@mayank99 mayank99 removed the needs more info This issue is waiting on more info from author label Aug 13, 2024
@MartynasStrazdas
Copy link

MartynasStrazdas commented Nov 14, 2024

Hi, we recently removed GlobalContextMenu and implemented Gerardas workaround using a dropdown menu. Are there any updates or plans to support a right-click-based dropdown menu or possible adjustments to the existing dropdown menu? @mayank99

@mayank99
Copy link
Contributor

@MartynasStrazdas There is no update on it right now. We want to take the time to do it right, and we currently do not have the bandwidth for it.

However, what we can do in the meantime is expose a prop that allows changing the position of DropdownMenu so that you do not need to hack around it.

@jsnaras
Copy link

jsnaras commented Nov 29, 2024

Hi, I am hereby adding an upvote to having a ContextMenu feature-equivalent component in iTwinUI. Thank you!

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

No branches or pull requests

4 participants