I'd like to control enable/disable input box.
How to do?
Now, i write like this.
$('.typeahead).typeahead(.....);
$('.typeahead).on('typeahead:selected', function ...)
...
$(selector)
.removeAttr('disabled')
.prev().remove()
.removeClass('.typeahead')
.addClass('.typeahead');
...
But, I don't know .prev().remove() is sufficient or not.
Could you please support this api?
I'm curious why this was closed and if there is a proper way to dynamically disable/enable the input field to which typeahead.js is applied. I'm using Vue.js to control when a field is disabled.
<input type="text" v-bind:value="person.name" v-bind:disabled="disabled">
What seems to be happening is that the input associated with tt-input seems to update properly, but the tt-hint input field does not. It seems to stay in the initial state of tt-input when typeahead was applied.
Since tt-input is transparent, the ghosting doesn't update properly. eg when disabled turns to false, tt-input is enabled, but tt-hint isn't, so the input field stays greyed out.
Most helpful comment
I'm curious why this was closed and if there is a proper way to dynamically disable/enable the input field to which typeahead.js is applied. I'm using Vue.js to control when a field is disabled.
<input type="text" v-bind:value="person.name" v-bind:disabled="disabled">What seems to be happening is that the input associated with tt-input seems to update properly, but the tt-hint input field does not. It seems to stay in the initial state of tt-input when typeahead was applied.
Since tt-input is transparent, the ghosting doesn't update properly. eg when
disabledturns to false, tt-input is enabled, but tt-hint isn't, so the input field stays greyed out.