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

Throw when cancelling or clicking outside #946

Closed
skjnldsv opened this issue Aug 24, 2023 · 5 comments · Fixed by #963
Closed

Throw when cancelling or clicking outside #946

skjnldsv opened this issue Aug 24, 2023 · 5 comments · Fixed by #963
Labels
bug Something isn't working

Comments

@skjnldsv
Copy link
Contributor

skjnldsv commented Aug 24, 2023

When you click outside or close, it still returns a path: "/".

Example given: For the Move action, if you click outside, I expect to cancel.
Right now it's impossible to differentiate a cancellation and picking the root folder

@skjnldsv skjnldsv added the bug Something isn't working label Aug 24, 2023
@susnux
Copy link
Contributor

susnux commented Aug 24, 2023

What API?

  • The FilePickerBuilder rejects the returned promise on close / cancel.
  • The Vue commponent emits the close event

At least that is what should happen, if it does not, than this is a bug.

@skjnldsv
Copy link
Contributor Author

picker.pick() should throw?
I'm not seeing this unfortunately :/

See https://github.com/nextcloud/server/blob/6c632a17c5912c330b045b6f1d85025a9d9d9f7b/apps/files/src/actions/moveOrCopyAction.ts#L200-L203, what am I doing wrong?

@skjnldsv skjnldsv changed the title Throw when cancelling or clicking uotside Throw when cancelling or clicking outside Aug 24, 2023
@susnux
Copy link
Contributor

susnux commented Aug 25, 2023

picker.pick() should throw?

Yes it should reject:

if (!nodes) reject(new Error('Nothing selected'))

@skjnldsv
Copy link
Contributor Author

It doesn't 🙈

@susnux
Copy link
Contributor

susnux commented Aug 25, 2023

Well then this is a bug, I try to investigate

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
2 participants