- π¨π¦Canada mgifford Ottawa, Ontario
Even adding an HR would help.
Here's a useful guide to best practices as of 2023 - https://adrianroselli.com/2023/10/splitting-within-selects.html
- πΊπΈUnited States alison
Hi all! Following up on a Slack conversation...
A "solution" some of my colleagues came up with -- not going to be a broadly helpful solution, but it might help some folks who come across this issue (note: see "Limitation" below!) --
TL;DR: We're using
optgroup
elements, and repeating the first/parent item, so that there's a "selectable" version of that parent item (optgroups themselves aren't selectable).β οΈ Limitation: You can't nest optgroups, so this solution only works with one hierarchy-level, so to speak. As such, it isn't a solution for menus, and it won't work with "has taxonomy term (with depth)" situations with more than 2 depth levels. So, like I said, it's not going to be helpful for actually solving this broader issue, but I'm sharing anyway, in case it helps someone with a comparable use case!
-------
All the details are in this "optgroup demo" gist. (Let me know if you have any questions -- I'll see updates here, but the quickest way to reach me is on Drupal Slack: @alison)