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

UiFileupload: also reset placeholder when clear is called #510

Merged

Conversation

MiniGod
Copy link
Contributor

@MiniGod MiniGod commented Sep 10, 2020

When calling clear() on UIFileupload, I expected the placeholder to be cleared as well.

Use case:
I want an upload button that

  1. always displays "Upload", and not the name of the selected file
  2. possible to select the same file twice in a row

The latter can be solved with clear() today, but it appears that the only way I can reset the placeholder today is by setting this.$refs.upload.hasSelection = false, but that's dirty and undocumented.

With this patch, I can call clear() in the change or input event handler, and both 1 and 2 are satisfied.

@JosephusPaye JosephusPaye merged commit e2913ae into JosephusPaye:next Sep 11, 2020
@JosephusPaye
Copy link
Owner

Merged, thanks!

@JosephusPaye
Copy link
Owner

Released in v1.3.1

@MiniGod MiniGod deleted the fileupload-clear-clears-placeholder branch September 14, 2020 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants