Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Select current folder" not possible with hidden Select button #71

Closed
VP- opened this issue Jun 16, 2021 · 4 comments · Fixed by #75
Closed

"Select current folder" not possible with hidden Select button #71

VP- opened this issue Jun 16, 2021 · 4 comments · Fixed by #75
Assignees
Labels
bug Something isn't working

Comments

@VP-
Copy link

VP- commented Jun 16, 2021

When using external buttons to confirm the selection, the consumer of the file picker widget relies on update events to track the current selection. In location mode, the event fired after entering a new folder does not include any entries. This makes it impossible to select the current folder, like the internal button allows to.

To solve this, either a separate event for navigation is required, or the update event in location mode needs to include the current folder when nothing else is selected.

Also, when issue #8 is implemented, the navigation/update event will need to be fired on initial load to communicate the actual permissions of the starting folder, i.e. whether the user is allowed to upload files there. If the root folder can have restricted permissions, then an initial event is already required now.

@kulmann
Copy link
Contributor

kulmann commented Jun 16, 2021

IMO the update event should always reflect the current selection model for when you would otherwise click the submit button in the file-picker. Since the location mode selects the current folder if nothing is selected, I think it would make sense that the update event propagates the current folder on navigation.

@kulmann kulmann added the bug Something isn't working label Jun 16, 2021
@LukasHirt
Copy link
Collaborator

LukasHirt commented Jun 18, 2021

Done in #72 and will be released in 0.7.0 (#73)

@VP-
Copy link
Author

VP- commented Jun 18, 2021

It works now, but the API is a bit inconsistent: the update event during navigation contains the current folder as a single resource, while normal update events contain an array of them (i.e. different array nesting levels, and therefore different types of arguments).

Luckily that was necessary. Otherwise there is no way to detect when a subfolder was selected via navigation or via selection. This is used to determine the text of the select button (whether to add the word "current" or not).

So either the API documentation should be updated to reflect the different argument types, or the consumer needs some other way to distinguish whether the user will select the current folder or a selected subfolder.

@kulmann kulmann reopened this Jun 19, 2021
@kulmann
Copy link
Contributor

kulmann commented Jun 19, 2021

cc @LukasHirt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants