1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

select2 4.0.6rcで、HTML data属性が反映されない

1
Posted at

問題

select2は、HTMLのdata属性を読んで初期化してくれるが、4.0.6rcでは、バグがあって読んでくれない。

こんなふうにできるけど、

<select class="select2" data-width="300px"></select>
$(() => {
  $('.select2').select2()
})

4.0.6rcでは、300pxが反映されない。

see: https://github.com/select2/select2/issues/5320

対処

現状では、最新の正式リリース 4.0.5 を使うしかなさそう

yarn add select2@4.0.5
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?