-
Notifications
You must be signed in to change notification settings - Fork 46.5k
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
Bug: File input element missing cancel event handler #27858
Comments
Another helpful link I meant to include is the browser compatibility for |
Can I get assigned this task?? |
Yes @Martins100-Tmd You can |
|
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment! |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you! |
React version: 18.2.0
Steps To Reproduce
input
of typefile
with acancel
prop like this to a functional component:<input type="file" cancel={cancel}>
Warning: Invalid value for prop `cancel` on <input> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. For details, see https://reactjs.org/link/attribute-behavior at input at App
Link to code example: https://codesandbox.io/p/sandbox/keen-grothendieck-jcr72t?file=%2Fsrc%2FApp.js
The current behavior
The
cancel
prop is considered an invalid prop on thefile
input
.The expected behavior
input
of typefile
includescancel
event listener.See documentation here: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#detecting_cancellations
See a working vanilla JS/HTML code example: https://jsfiddle.net/snjm9p5d/
The PR where this functionality was added to the HTML standard: whatwg/html#6376
The text was updated successfully, but these errors were encountered: