uptick / react-keyed-file-browser

Folder based file browser given a flat keyed list of objects, powered by React.
MIT License
295 stars 143 forks source link

How to create new file? #194

Closed jegatheesprana closed 2 years ago

jegatheesprana commented 2 years ago

We can create new folder or sub folder. But how to create a file?

dreadera commented 2 years ago

We can create new folder or sub folder. But how to create a file?

At this current stage, you cannot create a file in the same way you create a folder. However, you can create a component outside of the FileBrowser that mutates the file array thats passed to the FileBrowser which will allow this functionality :)

The idea of creating files within the library itself has been requested before, hence we do have it on our list of features we want to implement.

jegatheesprana commented 2 years ago

I looked at the source code and tried to add that feature. But I found that the necessary functions have already been developed. So I tried to add another action menu which will trigger required functions. But I ended up with some other issues. If I click newly added button, it triggers the function but not showing the input box. Later I found that this is happen because globalClickEventListener triggers at that time. Is this a problem you also face?