-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
FileUpload: Rewrite using ActivatorContent
pattern
#8694
FileUpload: Rewrite using ActivatorContent
pattern
#8694
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #8694 +/- ##
==========================================
+ Coverage 89.82% 90.13% +0.30%
==========================================
Files 412 419 +7
Lines 11878 12195 +317
Branches 2364 2403 +39
==========================================
+ Hits 10670 10992 +322
+ Misses 681 662 -19
- Partials 527 541 +14 ☔ View full report in Codecov by Sentry. |
Oh, didn't meant to select "approve" yet.
Don't think so, at least definitely not without JS |
Did some research and agree it's not easy without JS. Not sure about the context command though; Why can't the parent handle the |
I think this would work if we limited the I don't have the offhand knowledge right now but I would imagine if we did it with an onclick handler on the parent users would have to play with My first implementation also played around with giving focus to the hidden input as a quick and dirty solution but that meant the actual upload button didn't get it's hover/focus effect, so I think this solution would also require additional CSS (probably just adding the same classes to the div as the |
I'm confused as to why that example stuffed everything inside the button template instead of just placing it outside? I think the button template should be used purely for buttons with the expectation that a click effect will trigger the dialog. I think Yeah I had no luck with the input. I think what you have makes sense it's just that the button needs to be a, well, button 😄 |
I just remembered I was the one that added the At the time there were talks about adding a delete button to Essentially we need:
I have no implementation preference as long as those 4 points are met 👌 |
@Mr-Technician if you can find some time to review this please do so. |
MudMenu's ActivatorContent is what I picture |
I agree with @danielchalmers. The
Would a delete button behave any differently from calling |
Nope don't think it would -- I think I just have a preference for template context over component references in general. In this case I agree with @danielchalmers though in that Should we also try to remove |
Status report: Made progress with the Will push the changes and clean up unit tests and docs over the weekend! Edit: title and PR description will definitely need a change with these changes, to be updated once reviews are finalised. |
Ready for re-review! Keyboard navigation to standard buttons now works since we no longer need the This is now a breaking change due to the name change (users should be encouraged to switch away from |
@igotinfected Please add the renamed parameter to the illegal razor parameter detector. See #8771 |
Done! Simulated error here: Great idea for the huge migration, thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! @igotinfected
ActivatorContent
pattern
Added to v7.0.0 Migration Guide #8447 |
Description
Replaced
ButtonTemplate
withActivatorContent
. Anything withinActivatorContent
now activates the file picker.This allows us to use normal
button
tags (which can automatically be focused by keyboards) and trigger theOpenFilePicker
action with a mouse click or a keyboard press (space, enter, ...).Because of the rename (and the removal of
FileUploadButtonTemplateContext
) this is now a breaking change.Resolves #5779
How Has This Been Tested?
Visually + unit tests.
Types of changes
Basic example (with keyboard trigger)
keyboard-accessibility.mp4
Drag and Drop example
drag-and-drop.mp4
Documentation review
Reworded the first excerpt and the use of
MudButton
s:Reworded and fixed styling on the
Form Validation
example:Checklist
dev
).