How to get numbers of files during the dragging?
andrii-olefir-airslate opened this issue · comments
Describe the bug
I want to know how much files I dragging and show it on title
dragging files from os try to listen monitor.getItem() but always get
{ "files": [], "items": {}, "dataTransfer" }
how can I get this data before drop?
Reproduction
Steps to reproduce the behavior:
- dragging files from os
- drag enter to box and check the console
Screenshots
Desktop (please complete the following information):
- OS: macOS 12.0.1
- Browser chrome 116
- Version 16.0.1
Answer:
Note: The files property of DataTransfer objects can only be accessed from within the drop event. For all other events, the files property will be empty — because its underlying data store will be in a [protected mode]
https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/files