-
Notifications
You must be signed in to change notification settings - Fork 184
FileBrowser doesn't follow conditional rendering #149
Copy link
Copy link
Closed
Description
Use Case:
Give a BASE_PATH, user can only go into subfolders/files, but not go up levels.
Try 1:
base_path, set_path = solar.use_state(BASE_PATH)
def setter(path):
if some_condition:
set_path(path)
FileBrowser(directory=base_path, on_directory_change=setter)
This won't work, since directory only controls starting point but is not used to control current folder
Try 2:
base_path, set_path = solar.use_state(BASE_PATH)
if BASE_PATH in base_path:
FileBrowser(directory=base_path, on_directory_change =set_path)
else:
FileBrowser(directory= BASE_PATH, on_directory_change =set_path)
This also will not work, since even the condition is triggered correctly, but the Filebrowser widget itself won't rerender.
Is there anyway to control what are the folders that users can/cannot get into?
Thanks.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels