Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optgroup cannot be disabled. #4876

Closed
9 of 16 tasks
dsarosi opened this issue Apr 21, 2017 · 2 comments
Closed
9 of 16 tasks

Optgroup cannot be disabled. #4876

dsarosi opened this issue Apr 21, 2017 · 2 comments

Comments

@dsarosi
Copy link

dsarosi commented Apr 21, 2017

Prerequisites

  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate
  • The issue still exists against the latest master branch of Select2
  • This is not a usage question (Those should be directed to the community)
  • I have attempted to find the simplest possible steps to reproduce the issue
  • I have included a failing test as a pull request (Optional)

Steps to reproduce the issue

  1. Apply select2 to a simple select with a disabled optgoup

Expected behavior and actual behavior

When I follow those steps, I see...

I was expecting...

Environment

Browsers

  • Google Chrome
  • Mozilla Firefox
  • Internet Explorer

Operating System

  • Windows
  • Mac OS X
  • Linux
  • Mobile

Libraries

  • jQuery version: 3.2.0
  • Select2 version: 4.0.3

Isolating the problem

  • This bug happens on the examples page
  • The bug happens consistently across all tested browsers
  • This bug happens when using Select2 without other plugins
  • I can reproduce this bug in a jsbin

https://jsbin.com/birezar/edit?html,js,console,output

DVD27 added a commit to DVD27/select2 that referenced this issue Apr 22, 2017
@alexweissman
Copy link
Contributor

alexweissman commented Sep 27, 2017

Looks like a duplicate of #3347, possibly fixed by #5035.

@jackdeguest
Copy link

jackdeguest commented Apr 1, 2018

@alexweissman you can re-open this bug. As of the latest version ie 4.0.6 rc1 a disabled optgroup is not honoured in select2. This means that even though one has the following html in the select object

<optgroup label="Alaskan/Hawaiian Time Zone" disabled>
    <option value="AK">Alaska</option>
    <option value="HI">Hawaii</option>
</optgroup>

with select2, one can still select Alaska or Hawaii whereas in the pure html version of the select the disabled optgroup makes it impossible to select any option inside it.
The code pen is here: https://codepen.io/jdeguest/pen/eMrbJy
The code pen use rc0, but I checked with rc1 and the issue remains.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants