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

Disabling Undo option #30

Closed
LMarcinkowski opened this issue Apr 11, 2018 · 19 comments
Closed

Disabling Undo option #30

LMarcinkowski opened this issue Apr 11, 2018 · 19 comments

Comments

@LMarcinkowski
Copy link

How to disable Undo feature?

@rikschennink
Copy link
Collaborator

What do you mean by Undo feature.

@LMarcinkowski
Copy link
Author

This button "undo"
image

@rikschennink
Copy link
Collaborator

rikschennink commented Apr 11, 2018

It's currently not possible to disable this feature using configuration options (only the revert action that removes the temp file from the server can be disabled). Why do you want to disable it? What is the use case?

The only way currently to remove it is to hide it with CSS.

@LMarcinkowski
Copy link
Author

Because we don't want to let users delete files from this component

@rikschennink
Copy link
Collaborator

rikschennink commented Apr 11, 2018

Existing files? I assume a user can remove files they themselves added?

@LMarcinkowski
Copy link
Author

Yes, but not from this component :)

@rikschennink
Copy link
Collaborator

Okay, thanks for clarifying! Final question, if you don't mind, how are you using FilePond? It helps to know the use case to determine how to best integrate this feature.

@rayax86
Copy link

rayax86 commented Apr 24, 2018

Please, this is very important. There are many many cases you just want to avoid this, for example whenever a file is uploaded, it is processed and takes effect immediately. It would be meaningless to allow the user to revoke this file.

@rikschennink
Copy link
Collaborator

@rayax86 That would mean there's no way for the user to alter the interface state? The file is uploaded and stays green? Is that correct?

@rayax86
Copy link

rayax86 commented Apr 26, 2018

@rikschennink That's the idea. Just need to show a tick in the button and don't register any onclick handlers on it.

@rikschennink
Copy link
Collaborator

@rayax86 The Just in your sentence is where the problem is. It's never just doing something. 😊

If I leave the button, it indicates the user can click it, but it won't do anything ( as it does not trigger any events ). The subtext shows to "tap to undo" but as there's no button there's nothing to tap. Removing the subtext makes the design look unbalanced, etc.

I've set up the situation on my dev machine but it's weird to upload a file and not be able to then remove it or revert your decision. It's like if this text box I'm typing this comment in would not allow me to use my backspace button.

@rikschennink
Copy link
Collaborator

@snuuve @rayax86 I just published version 1.4.0 which now has a allowRevert setting which defaults to true, set it to false to disable the undo feature.

@rayax86
Copy link

rayax86 commented Apr 30, 2018

@rikschennink Thanks for the update 👍

By "leaving the button" I actually mean "show something that looks the same as the button but don't allow the user to click it". Sorry I didn't make it clear.

As for your statement "It's like if this text box I'm typing this comment in would not allow me to use my backspace button", please consider cases similar to Google Instant: whenever you type in something, it triggers a change of state in the application. It might not be your case but is indeed my case.

All in all thanks for the update, this is such an awesome component. Keep up the great work!

@rikschennink
Copy link
Collaborator

@rayax86 No problem!

I'm still struggling to understand the use case :)

@LordRampantHump
Copy link

i would like to be able to change the text from tap to undo to tap to continue or something

@rikschennink
Copy link
Collaborator

@LordRampantHump you can do so with the labelTapToUndo property
https://pqina.nl/filepond/docs/patterns/api/filepond-instance/#labels

@nehadhiman6
Copy link

nehadhiman6 commented Sep 2, 2020

Please provide this feature.. for disabling remove/undo button.. sometime i need that user can only see initial files but has no right to remove those files.. thanks

@rikschennink
Copy link
Collaborator

@nehadhiman6 allowRemove and allowRevert should cover that

@remotemerge
Copy link

I changed revert to null and updated the tap label. This works for my use case.

server: {
  revert: null,
},
labelTapToUndo: 'tap to close',

Between, I don't understand who looks for the file delete feature in the upload component? Still, thank you for the plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants