Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[Character Sheets] Optgroup issue workaround

1658988093
Zedafty
Pro
Sheet Author
Hello all ! It seems that the issue concerning the < optgroup > tag for character sheets has been reported later, and having experienced it recently, I thought it could be a good idea to share the thing done in my case to solve the issue and proceed forth. Well, after testing under different browsers with and without legacy sanitization, on both ordinary games and sandbox, it appears obvious to me that the tag is simply not supported for now (the sanitization leave it over). But, it is not without hope for those having long dropdowns lists and wishing to improve somewhat the readility :) A trick is to simply leave < option > entries (instead of < optgroup >) BUT with the disabled attribute set on. That way, the user can't select the option, but can sen its text node, so the textual information is passed on to it. Obviously, it's not great ... But at least the job is done :)
1658990078
GiGs
Pro
Sheet Author
API Scripter
That's a good solution. I think the bug with optgroup might be that it doesn't work with custom sheet games, but it works with sheets being loaded from the Roll20 repo. I'm not sure, but I think I've seen working sheets using optgroup, and that was the key. But it's a while ago and my memory might be playing tricks :)
1659004342
Zedafty
Pro
Sheet Author
Thank you GiGs for your experise ! That's right ! From the Roll20 repo the < optgroup > works just well (just tested on RogueTraderImproved Character Sheet, no issue). So it's only for custom sheets, as you wrote ;) Well, didn't mention it in the above workaround, but for custom sheet creators, you can also use CSS on < optgroup > in order to improve the readability. In the below screenshot, the < option disabled > gets a darken background-color, bold and italic font (color also works ; tested on both Firefox and Brave).