trigger event
Opened this issue · 2 comments
bogdancss commented
I have functionality that updated the input value in other way that typing into the input field (e.g. click a button and update the input to 'test value').
$('#search').val('test-value')
I need to trigger an event to update the width of the input field. I tried using jquery trigger with 'keydown', 'change' and 'input' events, but nothing happened:
$('#search').trigger('input')
itayganor commented
Please make a solution for it!
pomartel commented
I found a work-around for this. The autosizeInput
call returns a function that can be invoked to update the size of the input. You can run that function with an interval timer to pull for changes:
var autosize = autosizeInput(elem)
setInterval(function () { autosize() }, 100)