0

There's a removeAllTokens method here and I've seen how to trigger another method from the docs, however it is for angular in the docs and I'm not sure how I can call the removeAllTokens method as I'm using NS-Vue.

An insight would be appreciated

Ayudh
  • 1,673
  • 1
  • 22
  • 55

1 Answers1

1

You can set an id on your autocomplete element and when you programmatically want to remove all tokens, just use this

import { Frame } from '@nativescript/core'

const autoCompleteView = Frame.topmost().getViewById('<id of autocomplete view>');
if (autoCompleteView && typeof autoCompleteView.removeAllTokens === 'function') {
  autoCompleteView.removeAllTokens();
}
Shiva Prasad
  • 430
  • 2
  • 12