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

feat(ContextMenu): Add OnClickBefore callback event #4112

Merged
merged 16 commits into from
Aug 22, 2024
Merged

Conversation

h2ls
Copy link
Collaborator

@h2ls h2ls commented Aug 22, 2024

Add OnClickBefore callback event

Description

I would like to propose a new feature for the ContextMenu component: an OnClickBefore callback event. This event should be triggered right before the context menu is displayed when the user right-clicks. It would allow developers to perform actions or checks before the menu is rendered to the user.

Use Case

The OnClickBefore event would be extremely useful for dynamic context menu content, where menu items need to be determined based on the state of the application or specific conditions at the time of the right-click. For example, it could be used to enable or disable menu items, add new ones, or even cancel the display of the context menu altogether based on certain criteria.

Proposed Signature

[Parameter]
public Func<object?, Task>? OnClickBefore { get; set; }

close #4111

Copy link

bb-auto bot commented Aug 22, 2024

Thanks for your PR, @azlis. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@bb-auto bb-auto bot requested a review from ArgoZhang August 22, 2024 01:45
@bb-auto bb-auto bot added the enhancement New feature or request label Aug 22, 2024
@bb-auto bb-auto bot added this to the v8.8.0 milestone Aug 22, 2024
ArgoZhang
ArgoZhang previously approved these changes Aug 22, 2024
Copy link

codecov bot commented Aug 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (8a4a136) to head (a68cfcc).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #4112   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          597       598    +1     
  Lines        25941     25981   +40     
  Branches      3778      3784    +6     
=========================================
+ Hits         25941     25981   +40     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ArgoZhang ArgoZhang merged commit 73b6a4a into main Aug 22, 2024
3 checks passed
@ArgoZhang ArgoZhang deleted the lee/ContextMenu branch August 22, 2024 04:33
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

Successfully merging this pull request may close these issues.

feat(ContextMenu): Add OnClickBefore callback event
2 participants