Skip to content

Checkbox disabled Attribute Not Working with checkbox_options Plugin in Tom Select [Bug]:  #792

@nassiry

Description

@nassiry

Bug description

I'm using Tom Select in a Laravel project to manage a multiselect dropdown with checkboxes. I’m leveraging the checkbox_options plugin to allow users to select multiple items in a folder structure.
When a parent folder (e.g., "app") is selected, I want all child folders (e.g., "app/Helpers", "app/Http") to become unselectable (i.e., disabled). Ideally, these child options should visually appear disabled and not respond to user interaction.

Expected behavior

Issue Although I'm able to set the disabled attribute on checkboxes programmatically when a parent folder is selected, the disabled state does not prevent child checkboxes from being selectable. Specifically:

  • The checkboxes visually show the disabled attribute, but they are still selectable.
  • Adding both disabled and an additional disabled class to the .option element does not seem to fully prevent interaction.
  • I attempted to override click events with JavaScript, but I’d like to avoid such workarounds if possible and instead achieve this directly through Tom Select’s functionality.

Steps to reproduce

  1. click here jsFiddle
  2. the first option already had selected attribute. the rest of related children must be disabled.

Additional context

  • OS: ubuntu 24
  • Browser chrome 129
  • Version v2.3.1

this stackoverflow link Here

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions