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

Choices does not behave like other HTML elements in a disabled fieldset #1132

Open
tagliala opened this issue Sep 12, 2023 · 0 comments
Open
Labels

Comments

@tagliala
Copy link

tagliala commented Sep 12, 2023

Describe the bug
It is expected that HTML elements are disabled in a globally disabled fieldset

Ref: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/fieldset#attributes

If this Boolean attribute is set, all form controls that are descendants of the <fieldset>, are disabled, meaning they are not editable and won't be submitted along with the <form>. They won't receive any browsing events, like mouse clicks or focus-related events. By default browsers display such controls grayed out. Note that form elements inside the <legend> element won't be disabled.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://jsfiddle.net/tagliala/yetk9sgh/13/

Expected behavior
Choices.js appears and behave like a disabled fieldset

Screenshots

image

Desktop (please complete the following information):

  • OS: macOS 13.5.2
  • Browser Chrome / Safari / Edge
  • Version: latest

Additional context
On Firefox, the element is not interactable but it looks like an interactable field

Workaround

  callbackOnInit: function () {
    // Workaround for Choices-js/Choices#1132
    if (this.passedElement.element.closest('fieldset:disabled')) {
      this.disable()
    }
  },
@tagliala tagliala added the bug label Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant