mfairburn / activeadmin-select2

ActiveAdmin Select2 integration
MIT License
55 stars 66 forks source link

Jquery 3 compatibility #19

Closed brendon9x closed 1 year ago

brendon9x commented 6 years ago

jQuery dropped support for on("ready") in version 3.0, so PR involves separating that out into the only way that will be supported for jQuery 4.0 (namely: $(handler)). This also caters for select2 now trying by default to size the input to the same size as the underlying input. Adding width: style keeps old behavior)

fxylee commented 6 years ago

Breaking change: .on("ready", fn) removed - jQuery Core 3.0 Upgrade Guide 我遇到同样的问题。 Rails 5.1.5已经默认加载的是jQuery 3.2.0了。 我暂时是通过引入jQuery 2 或Turbolinks 5 来解决。

# app/assets/javascript/active_admin.js.coffee

#= require jquery2

# or

#= require turbolinks