Conversation
The hidden file input was triggered via native label forwarding through an NcButton wrapped in <label for="uploadicon">. NcButton attaches its own click handler and renders a <button> inside the <label> (invalid interactive content), so the click never reached the input and no file picker opened. Replace the label with an explicit @click handler that programmatically clicks the hidden input via a template ref. Fixes nextcloud#1113
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
Fixes #1113
Problem
On Administration → External sites, clicking "Upload new icon" did nothing: no file picker opened, no network request fired, no console error.
Root cause
The hidden
<input type="file">was triggered via native label forwarding through anNcButtonwrapped in<label for="uploadicon">.NcButtonattaches its own click listener and swallows the event before native label → input forwarding happens (a<button>inside a<label>is also invalid interactive content, so browsers won't do label activation anyway).Fix
Drop the
<label>wrapper and give theNcButtonan explicit@clickhandler that programmatically clicks the hidden input through a Vue template ref. Triggering the input directly was already proven to work in the issue thread, and the upload backend path is unchanged.Testing
Built from this branch and deployed the resulting
js/external-admin.mjs(+ matching CSS) onto a Nextcloud 34 / External 9.0.1 instance: the file picker now opens, the upload completes with "Icon uploaded successfully", and the icon appears in the list. Page styling verified intact.🤖 AI (if applicable)
(but verified by a human)