You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
first of all thank you for this library but I am struggling trying to disable options using remote populate.
Describe the bug
My Choices options are populated through a remote webservice (by the way a settings options giving the fetchUrl and fetchCallback would be better than addEventListener on search but that's another story). Among the options returned by the webservice, some options need to be disabled because I explicitly want to display them (For example i want to show the user has been found but he's disabled, i mean not clickable).
Problem is , if i set disabled = true to my choice item, the option is not showing anymore.
I am using callbackOnCreateTemplates to custom the display.
in the callback promise, map the json data with {id, value, label, disabled} like :
results.push({
value: user.id,
label: user.firstname + ' ' + user.lastname,
disabled: user.disabled
})
I tried to find a workaround using customProperties.disabled and not directly the property disabled. So in the callbackOnCreateTemplates i am using the correct classes. And then my user is displayed with the gray disabled class but still clickable and added (this is not what i want)
See errorExpected behavior
Screenshots
On the screenshot is an example of the customProperties.disabled = true . As you can see the disabled classes are correct but user is still clickable . For my example all the users are disabled.
Choices version and bundle
Version: [v11.0.3 choices.min.js]
Thank you for help
The text was updated successfully, but these errors were encountered:
Hello,
first of all thank you for this library but I am struggling trying to disable options using remote populate.
Describe the bug
My Choices options are populated through a remote webservice (by the way a settings options giving the fetchUrl and fetchCallback would be better than addEventListener on search but that's another story). Among the options returned by the webservice, some options need to be disabled because I explicitly want to display them (For example i want to show the user has been found but he's disabled, i mean not clickable).
Problem is , if i set disabled = true to my choice item, the option is not showing anymore.
I am using callbackOnCreateTemplates to custom the display.
To Reproduce
Steps to reproduce the behavior:
addEventListener('search') fetching remote webservice
in the callback promise, map the json data with {id, value, label, disabled} like :
results.push({
value: user.id,
label: user.firstname + ' ' + user.lastname,
disabled: user.disabled
})
I tried to find a workaround using customProperties.disabled and not directly the property disabled. So in the callbackOnCreateTemplates i am using the correct classes. And then my user is displayed with the gray disabled class but still clickable and added (this is not what i want)
See errorExpected behavior
Screenshots
![Image](https://private-user-images.githubusercontent.com/5296748/405599638-e7c9bf91-8e39-4c68-b943-49b97677f681.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzNTk3MjMsIm5iZiI6MTczOTM1OTQyMywicGF0aCI6Ii81Mjk2NzQ4LzQwNTU5OTYzOC1lN2M5YmY5MS04ZTM5LTRjNjgtYjk0My00OWI5NzY3N2Y2ODEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTJUMTEyMzQzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NTUyOTE3ZGQxYjIyNjViNmU3NGE2Y2E1ZjI3MjUwMDJmMzJkZGFmNDA5OTcwNzZmNmEzMDk5NDRjZTFlMjI1MiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.e0NbU3G2ipjTQ3D60m8SQSOhdHTee_3mvYB66p5ulv0)
On the screenshot is an example of the customProperties.disabled = true . As you can see the disabled classes are correct but user is still clickable . For my example all the users are disabled.
Choices version and bundle
Thank you for help
The text was updated successfully, but these errors were encountered: