Skip to content

Add computedstyle option for calculating the width#5559

Merged
kevin-brown merged 1 commit into
developfrom
GH-3278
Jul 9, 2019
Merged

Add computedstyle option for calculating the width#5559
kevin-brown merged 1 commit into
developfrom
GH-3278

Conversation

@kevin-brown

Copy link
Copy Markdown
Member

This allows for more accurate resolution of the width when compared
to the resolve method. This is more relevant for jQuery 1.x, where
the resolve method cannot find the width of a hidden select box,
but it also applies to newer versions of jQuery where the width()
method provided by jQuery doesn't fully match getComputedStyle().

Fixes #3278
Fixes #5502
Closes #5259

This pull request includes a

  • Bug fix
  • New feature
  • Translation

The following changes were made

  • Added computedstyle option
  • Added tests to make sure that it works across all jQuery versions

This allows for more accurate resolution of the width when compared
to the `resolve` method. This is more relevant for jQuery 1.x, where
the `resolve` method cannot find the width of a hidden select box,
but it also applies to newer versions of jQuery where the `width()`
method provided by jQuery doesn't fully match `getComputedStyle()`.

Fixes #3278
Fixes #5502
Closes #5259
@kevin-brown kevin-brown merged commit b5f136f into develop Jul 9, 2019
@kevin-brown kevin-brown deleted the GH-3278 branch July 9, 2019 23:44
maxwellfet928 pushed a commit to maxwellfet928/select2 that referenced this pull request Jun 8, 2026
This allows for more accurate resolution of the width when compared
to the `resolve` method. This is more relevant for jQuery 1.x, where
the `resolve` method cannot find the width of a hidden select box,
but it also applies to newer versions of jQuery where the `width()`
method provided by jQuery doesn't fully match `getComputedStyle()`.

Fixes select2#3278
Fixes select2#5502
Closes select2#5259
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issues with responsive width

2 participants