Choices-js / Choices

A vanilla JS customisable select box/text input plugin ⚡️
https://choices-js.github.io/Choices/
MIT License
6.16k stars 607 forks source link

Custom Properties does not work when optgroup on a select #1155

Closed jbender0 closed 1 month ago

jbender0 commented 4 months ago

I'm using custom properties (inline data attribute) to display a description and thumbnail image. This works fine on a regular select field. But when I add optgroup within the select, it falls apart and only loads the option label. All custom properties are returned as undefined.

The custom property attribute is valid JSON and when I turn off the Choices script it loads correctly with optgroup just fine. So there's definitely a bug in Choices.

Here's a screenshot of it working with no optgroup and after optgroup is added (no thumbnails or custom properties).

Screenshot 2024-05-17 at 1 38 32 PM Screenshot 2024-05-17 at 1 40 54 PM

Using macOS latest Chrome (v124.0).

Anyone else ran into this bug?