Introduce custom design of FileInputField (#244)#601
Conversation
3137de8 to
17e8a64
Compare
67dd040 to
c779f4f
Compare
bedrich-schindler
left a comment
There was a problem hiding this comment.
During our call with @mbohal, we agreed on several things:
- Change of
onDragOveris described here: #601 (comment) - Due to complexity, we do not want to use synthetic events but rather custom prop that would cover input change and file drop at one place, something like
onFilesChangedand document it. This is missing in the documentation yet. Due to its complexity, this can't be omitted. - We do not want to make drag props available as we do not see benefits now and while do not want to use synthetic event.
onChange, it would follow the same approach. - We are not sure about transferProps. Currently, input is hidden and logic is provided through button and droppable area. While we do not want to provide traditional synthetic event
onChangeand input is hidden, are transfer props placed on correct element? Is input where all aria attributes should be placed? We frankly do not know yet.
We want |
@bedrich-schindler @mbohal I admit I need a guidance regarding this change. Could you drop a suggestion somewhere in the code so I can fully understand it and do the rest of the work? 🙏🏻 |
This means that prop <input onChange={(e) => {
onFilesChanged(e.target.files, e);
}}and on droppable label (I guess): <label onDrop={(e) => {
onFilesChanged(dataTransfer.files, e);
}}Maybe prevent default actions if needed. And document this. |
This was request from @mbohal. You can for example use spread to omit all drag/drop events from the transfer props, so even if defined, it never gets into component. This should be documented as well. |
Since the drop related event handlers must be specified on the root So, for example, I think that in const handleDrop = (event) => {
event.preventDefault();
handleFileChange(event.dataTransfer.files);
setIsDragging(false);
}I hope I answered. If not, just give me a call so we can get this out of the way. |
|
If I have:
|
bedrich-schindler
left a comment
There was a problem hiding this comment.
I have to provide comment for "Request changes", but the issues are already top comments.
7e8eeaa to
7addc9a
Compare
|
FYI @mbohal @bedrich-schindler, I made the |
|
Approved on a call last week, merging. |

Closes #244.