On other textareas that are not dynamically it's working. Okay, at least I found the problem: The textareas are generated by AJAX, so they are dynamically generated. But still the same error.Īny more suggestions on what I could do to make it work? I even tried to remove the yarn package and download the files. If you use this, make sure you have already included a umd React build. You can also use the umd build by including dist/AutosizeInput.js in your page. Then I tried setting a global scope for the variable: tosize = autosize įor initialization I followed the readme: autosize($('textarea')) The easiest way to use React-Input-Autosize is to install it from NPM and include it in your own React build process (using Browserify, rollup, webpack, etc). You can use this to adjust your text relative to the height you want. Then I imported it in different ways to try if it works somehow (as all other plugins are working). Here's a way to find the height of the text that you are using. Then I required it in my application.js, I tried different solutions: require("autosize") I added the plugin via yarn with yarn add autosize I'm trying to get autosize.js to work in my Rails 6 application but it doesn't matter what I try, it's not working.Įvery time I try to use it on a textarea I'm getting this error:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |