Skip to content

FileUpload: Event Propagation Not Prevented Inside ActivatorContent #9870

@Namoshek

Description

@Namoshek

Things to check

  • I have searched the existing issues for this bug
  • To rule out a caching problem I made sure the bug also happens in an incognito tab

Bug type

Component

Component name

MudFileUpload

What happened?

When the ActivatorContent contains buttons (e.g. to clear the selected files), stopping the event propagation does not work. The result is that not only the button OnClick action is executed but also the file selection window is opened.

This is unexpected because the default behavior of buttons should be ClickPropagation="false", which should stop the event propagation. However, also adding ClickPropagation="false" manually to the buttons does not change the behavior (see snippet).

The relevant part of the MudFileUpload component is probably this part of the ActivatorContent. However, it could also be that the issue is with the MudButton and not the MudFileUpload.

Expected behavior

I would expect that the button OnClick action is executed. The file selection window should not be opened afterwards.

Reproduction link

https://try.mudblazor.com/snippet/wuwIEtwqIZHtvejl

Reproduction steps

The issue can be viewed with any of the following two options:

  1. Select a file using the open file picker button. After selecting a file, the file picker is opened a second time.
  2. Select a file, then use the clear button. The file input is cleared and the file picker is opened afterwards.

Relevant log output

No response

Version (bug)

7.8.0

Version (working)

No response

What browsers are you seeing the problem on?

Chrome

On which operating systems are you experiencing the issue?

Windows

Pull Request

  • I would like to do a Pull Request

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUnexpected behavior or functionality not working as intendedhas workaroundBug issues only: A temporary or alternative solution is available and documented in the thread

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions