I need to be able to disable a checkbox within a checklist. As it appears that functionality doesn't exist, I've forked the repo and worked out a solution, but it's incredibly hacky. I'd appreciate suggestions on how to better solve this.
When this renders, the disabled property is dropped from the DOM. Strangely, it does work if the type is radio or text. Also, other properties will persist, such as the misspelled disabld.
Second try:
Since the disabled property is being dropped, change it to data-disbled, and handle afterwards:
I need to be able to disable a checkbox within a checklist. As it appears that functionality doesn't exist, I've forked the repo and worked out a solution, but it's incredibly hacky. I'd appreciate suggestions on how to better solve this.
Dataset:
First try:
When this renders, the
disabled
property is dropped from the DOM. Strangely, it does work if the type isradio
ortext
. Also, other properties will persist, such as the misspelleddisabld
.Second try:
Since the
disabled
property is being dropped, change it todata-disbled
, and handle afterwards:In this case, the
data-disabled
property persists, and theconsole.log(disabled)
shows that the query found them, but they are still not disabled.Third try:
Perhaps is was some race condition:
Now it works, but how it makes me cringe. Also, the unit test does not find the disabled checkboxes in its query:
Any suggestions on how to better solve this would be much appreciated!