ipyfilechooser icon indicating copy to clipboard operation
ipyfilechooser copied to clipboard

Allow pasting of path

Open pkgh-mp opened this issue 4 years ago • 1 comments

Hi,

I would like to propose the following usecase: As a user I want to paste a path I have copied in my clipboard into the FileChooser quick navigation dropdown to change to the path's directory.

If I have the path available as a string that allows me to very quickly select files from that path. If the path points to a file the parent directory should be used.

What do you think about that suggestion?

Thanks for your efforts, love it already!

pkgh-mp avatar Jun 07 '21 09:06 pkgh-mp

Thanks for your suggestion. I've tagged it as an enhancement, but I can't provide any timeline on when this would eventually be implemented.

crahan avatar Jun 07 '21 18:06 crahan

The best option would be to first extract the folder path and stripping the filename outside of ipyfilechooser. Then using the path value with the following code to open the ipyfilechooser dialog and set the form values to the extracted path and an empty filename:

# Open ipyfilechooser to the selected path
fdialog._show_dialog()
fdialog._set_form_values(os.getcwd(),'')

crahan avatar May 11 '24 11:05 crahan