Open sheminusminus opened 5 years ago
I apologize if this is a duplicate, but I can't translate the non-English issue titles :(
@afc163 Sorry, could you provide some context with that link? (Are you suggesting I use a normal button instead of the component with the actual file input in it? Or is this just for-reference?)
just for reference
Seems it's caused by onFocus
not pass to internal tag component. Maybe add this?
ref: https://github.com/react-component/upload/blob/master/src/AjaxUploader.jsx#L221
Is this issue not going to be resolved? It seems like a pretty simple fix to add an optional onFocus
prop to the component. This looks like it deserves a "Good First Issue" tag since it is such a basic fix.
Reproduction link
Steps to reproduce
<Upload />
component to any form or pageonFocus
callback using any method (either by clicking on the Upload component, or by pressing tab until it focuses, etc)onFocus
props will not be firedWhat is expected?
Form inputs need
onFocus
event callbacks; it's expected that any focusable input has it, and this has been standard input behavior for decades now. Tthe underlying file input allows all the regular methods of focusing, thus it is expected that the focus event callback would exist on<Upload />
like it does with any other form field.What is actually happening?
onFocus
callbacks are not fired for any of keyboard, mouse, or screen-reader focus events.Beyond it being expected/standard behavior, the absence of
onFocus
here adds unnecessary difficulty and extra code when implementing nice accessibility features, smooth client-side validations, and other misc dev tasks that don't really need to be more tedious than they already can be. XD