Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trigger event #11

Open
bogdancss opened this issue Mar 16, 2017 · 2 comments
Open

trigger event #11

bogdancss opened this issue Mar 16, 2017 · 2 comments

Comments

@bogdancss
Copy link

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
Copy link

Please make a solution for it!

@pomartel
Copy link
Contributor

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants