'How to disable drag and drop of folders but not files in SharePoint online Document library?

I am using SharePoint online. I have a requirement, in the Document Library users are not allowed to drag and drop folders but they can drag and drop files. If a folder is dragged I need to show a warning. How can we achieve this? I was trying with SPFx but had no luck. Can I add event listener to detect folder drop before it is dropped?. Any suggestion to achieve this would be really helpful



Solution 1:[1]

Not sure if this is achievable. You might want to have a look into this:

How can I disable the Document Library drag and drop function?

Also you can read this ms doc:

Information about dragging files into document libraries in SharePoint Server 2013 or SharePoint Online by using a web browser

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Tafsir Ahamed