vue-awesomplete icon indicating copy to clipboard operation
vue-awesomplete copied to clipboard

Clearing the input

Open ardian-c opened this issue 7 years ago • 6 comments

Hi,

Thanks for the plugin, it does the job well. There is one thing though, when trying to clear the input the shadow-root "inner-editor" doesn't allow that. Is there a way to get around this?

Thanks

ardian-c avatar Oct 24 '17 14:10 ardian-c

How do you clear the input?

sandi-racy avatar Oct 24 '17 15:10 sandi-racy

By reseting the text of input using plain Javascript.

ardian-c avatar Oct 24 '17 15:10 ardian-c

Have you tried this.$refs.skills.internalValue = null ?

sandi-racy avatar Oct 24 '17 15:10 sandi-racy

I'm trying to clear all inputs, and clearing button is in another component and I cannot access through this.$refs.

ardian-c avatar Oct 24 '17 15:10 ardian-c

Any updates on the issue?

ardian-c avatar Oct 26 '17 08:10 ardian-c

I created a button ...

<div class="level-item" v-if="autocompleteDirty">
  <a class="button is-small is-black is-inverted" @click="clearAutoComplete">
    <span class="icon is-small"><i class="far fa-trash-alt"></i></span>
  </a>
</div>

... whose click handler calls clearAutoComplete ...

  clearAutoComplete() {
    this.autocompleteDirty = false;
    this.$refs.prsnPckr.$el.value = '';
  },

this.autocompleteDirty = true; gets called in the input event handle of the vue-awesomplete element.

(Layout handled by Buefy/Bulma)

martinhbramwell avatar Aug 20 '18 12:08 martinhbramwell