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

MudBaseButton: Stop activation of IActivatable components when ClickPropagation is disabled #9626

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

igotinfected
Copy link
Member

Description

Thanks to the discussion in #9596 I found out that MudBaseButton triggers IActivatable cascading values when it is clicked. While the use case for MudFileUpload described in the mentioned issue isn't necessarily valid, I still think buttons should only trigger activation if ClickPropagation is enabled.

Note that by default ClickPropagation is false when the MudBaseButton inheritor uses the HtmlTag, implying it already has a custom action associated with it.

How Has This Been Tested?

Visually + bunit tests

Type of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (fix or improvement to the website or code docs)

Checklist

  • The PR is submitted to the correct branch (dev).
  • My code follows the code style of this project.
  • I've added relevant tests.

@igotinfected
Copy link
Member Author

Hmm I think my understanding of IActivatable and ClickPropagation isn't correct. MudMenu's ActivatorContent accepts any kind of content, but currently if you pass a MudButton to ActivatorContent with ClickPropagation set to true it will trigger the menu twice (1x via click propagation, 1x via IActivatable), i.e. keeping it closed.

Will rethink the approach / likely just provide a way to use the file upload as a drop zone only instead as the IActivatable logic seems correct to me on second thought.

@igotinfected igotinfected marked this pull request as draft August 13, 2024 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something does not work as intended/expected PR: needs review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant