-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
MudFileUpload File Drop Zone (ActivatorContent) Issue with MudBlazor 7.x.x #9596
Comments
Thanks for wanting to do a PR, @VinShen ! We try to merge all non-breaking bugfixes and will deliberate the value of new features for the community. Please note there is no guarantee your pull request will be merged, so if you want to be sure before investing the work, feel free to contact the team first. |
Personally, this doesn't seem like a bug to me but rather the correct and expected behavior. The fact that it worked the way YOU expected in v6 was likely just a lucky coincidence. Since the entire thing is inside the |
Yeah with v7 the file upload component was rewritten for multiple reasons like accessibility, HTML semantics, complexity, usability etc., this was just a side effect of the previous implementation where the I don't see any way to replicate the same behaviour other than potentially rendering the fileupload manually over just_ the rows, though with this approach (and the one you have right now) you're already losing out on row click features, are you not? |
@VinShen I copied your code from the original snippet and ran it locally using 6.21.0 (replaced The areas surrounded by red do not activate the file picker: By adding a div with <div @onclick:stopPropagation
@onclick:preventDefault>
...
</div> Could you try that and let me know? |
Excellent solution. Everything works as expected (no File Picker) except a small issue in MudTablePager First, Previous, Next, Last buttons, where File Picker opens on click. Please check in snippet sent by you. May be in future, it will be better, to provide a flag to disable opening of File Picker (when clicked on drop zone) in MudFileUpload when used specifically for Drag and Drop. In Drag Drop mode opening of File Picker every time on click is irritating. Thanks a lot for your help. |
@VinShen hmm weird, I'll check when I get home in a few hours. I think the "file drop zone only" logic can be useful in scenarios such as yours. I might look into a decent way to implement it provided the team thinks it should be part of the core component. |
Any updates regarding "file drop zone only" implementation discussion with Team and #9626 fix? |
@VinShen been busy with the fulltime job but I'll try to put some time aside over the weekend for it! |
Tried Version v7.7.0 - No changes in MudFileUpload. I am still using Version 6.21.0 Any updates regarding "file drop zone only" implementation discussion with Team and #9626 fix? |
@VinShen
Unfortunately the Obviously as @ScarletKuro mentions this is now not the intended way to use this now but in our case it has worked and will allow us to upgrade to v7 |
Things to check
Bug type
Component
Component name
MudFileUpload
What happened?
In MudBlazor 7.x.x
I am putting MudTable in ActivatorContent of MudFileUpload component for Drag & Drop of files. MudTable is Drop zone.
I have MudTableSortLabel in HeaderContent of MudTable and MudTablePager in PagerContent of MudTable.
The File Picker (File Open Dialog) opens when I click in free area of MudTable. - This is Right.
The Drag and Drop of Files works in free area of MudTable. - This is Right.
The File Picker opens when I click on Header the sorting - This is WRONG
The File Picker opens when I click in MudTablePager Page Selection - This is WRONG
Expected behavior
In MudBlazor 6.x.x
I am putting MudTable in ButtonTemplate of MudFileUpload component for Drag & Drop of files. MudTable is Drop zone.
I have MudTableSortLabel in HeaderContent of MudTable and MudTablePager in PagerContent of MudTable.
The File Picker opens when I click in free area of MudTable. - This is Right.
The Drag and Drop of Files works in free area of MudTable. - This is Right.
The File Picker does not open when I click on Header the sorting - This is RIGHT
The File Picker does not open when I click in MudTablePager Page Selection - This is RIGHT
Reproduction link
https://try.mudblazor.com/snippet/camIYsYZyadwIvum
Reproduction steps
Test with MudFileUpload - Hidden="@true" also.
Is it possible that the Drag and Drop will work, but the File Picker will not open on clicking ActivatorContent of MudFileUpload?
Can we add a flag to disable File Picker on click?
Please suggest solution.
Thanks
Relevant log output
No response
Version (bug)
7.0.0 ~ 7.6.0
Version (working)
6.21.0
What browsers are you seeing the problem on?
Chrome
On which operating systems are you experiencing the issue?
Windows
Pull Request
Code of Conduct
The text was updated successfully, but these errors were encountered: