-
-
Notifications
You must be signed in to change notification settings - Fork 155
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
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
disabledattribute, but they are still selectable. - Adding both disabled and an additional
disabledclass to the.optionelement 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
- click here jsFiddle
- 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
Labels
bugSomething isn't workingSomething isn't working