bernat / best_in_place

A RESTful unobtrusive jQuery Inplace-Editor and a helper as a Rails Gem
http://blog.bernatfarrero.com/in-place-editing-with-javascript-jquery-and-rails-3/
1.2k stars 573 forks source link

Textarea not working #622

Open alliedarmour opened 4 years ago

alliedarmour commented 4 years ago

The gem is great, but I think since the included autosize version is outdated, the :as => textarea isn't working anymore (at least for me). It always says:

jQuery(...).autosize is not a function

If you get the error, you can't submit the request anymore.

Is there any workaround that anyone figured out?

reedjosh commented 3 years ago

Just worked around this myself. Do yarn add autosize

Then...

import $ from 'jquery';
global.$ = jQuery;

import autosize from 'autosize';

$.fn.extend({autosize: autosize});

Autosize as a plugin is missing from the updated jQuery