JosephusPaye / Keen-UI

A lightweight Vue.js UI library with a simple API, inspired by Google's Material Design.
https://josephuspaye.github.io/Keen-UI/
MIT License
4.1k stars 437 forks source link

UiFileupload: also reset placeholder when clear is called #510

Closed MiniGod closed 4 years ago

MiniGod commented 4 years ago

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 commented 4 years ago

Merged, thanks!

JosephusPaye commented 4 years ago

Released in v1.3.1