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

optgroups no longer working

Are optgroups not supported anymore?  I had several setup on a custom sheet that are no longer working live or in the sheet dev sandbox.
1623816476

Edited 1623817851
vÍnce
Pro
Sheet Author
Looks to be working here (Freespacer sheet live/main, default sheet template, not custom) <select name="attr_selectedSheet" class="typeSelector"> <optgroup label="Player"> <option value="1" selected>Free Spacer Crewmember</option> <option value="2">Contingency type Corvette</option> </optgroup> <optgroup label="Gamemaster"> <option value="3">Sophont Log</option> <option value="4">Composite Sophont Log</option> <option value="5">Swarm Log</option> <option value="6">Creature Log</option> <option value="7">Behemoth Log</option> <option value="8">Drone Log</option> <option value="9">Shuttle Log</option> <option value="10">Small Craft Log</option> <option value="11">Ship Log</option> <option value="12">Capital Ship Log</option> </optgroup> </select> Is your custom sheet in legacy or CSE? Here's the snippet of code running in Custom legacy and here's the code running in Custom CSE Here's Custom CSE in the sandbox Maybe optgroup is broken in Custom and/or Sandbox games, but works live...?
It would seem so, it looks like there were a few other threads about this but they were closed after two months with no comment.  I don't remember seeing the Legacy checkbox before but it is checked and unchecking breaks the sheet worse.  We were just coming back from an 8ish month hiatus and I was going to make some changes to the sheet when I noticed the optgroups not working (as well as the Legacy checkbox).  Inspecting the page shows the <optgroup> tags have been stripped out entirely.  I decided to just switch over to disabled options with a background color as headings, not as nice but its functional and hopefully wont disappear with a future R20 update.  
1623861283

Edited 1623861365
Andreas J.
Forum Champion
Sheet Author
Translator
Yeah, AFAIK it haven't been fixed yet: <a href="https://wiki.roll20.net/BCS/Bugs#General" rel="nofollow">https://wiki.roll20.net/BCS/Bugs#General</a> The active Free Spacer sheet is somehow an outlier in this, any attempts to copy the optgroup format from that sheet somehow doesn't work. I decided to just switch over to disabled options with a background color as headings, Can you share the html &amp; css of your workaround?
eh I can but its so amateur its embarrassing. I'm not even using CSS just inline styling for a quick and dirty work around.&nbsp; I could get fancy and have a Select for the vision type and then do a show/hide on each type's modifier drop down list (one of the other optgroup threads talked about it) but I have a laundry list of changes to make and limited time each day to work on it and figured styling this is just such a low priority right now I just needed to bandaid it and move on and hope optgroups are fixed at some point.&nbsp; Before &lt;option value="6"&gt;Heavy Smoke/Fog/Rain&lt;/option&gt; &lt;/optgroup&gt; &lt;optgroup label="Technological Low-Light Vision"&gt; &lt;option value="8"&gt;Full Dark&lt;/option&gt; &lt;option value="4"&gt;Minimal Light&lt;/option&gt; &lt;option value="1"&gt;Partial Light&lt;/option&gt; And after &lt;option value="6"&gt;Heavy Smoke/Fog/Rain&lt;/option&gt; &lt;option disabled style="background-color: #e6e6ff;"&gt;Technological Low-Light Vision&lt;/option&gt; &lt;option value="8"&gt;Full Dark&lt;/option&gt; &lt;option value="4"&gt;Minimal Light&lt;/option&gt; &lt;option value="1"&gt;Partial Light&lt;/option&gt;
1623870350
Andreas J.
Forum Champion
Sheet Author
Translator
phillip M. said: eh I can but its so amateur its embarrassing. I'm not even using CSS just inline styling for a quick and dirty work around. Oh, that simple. But hey, it's better than nothing, as it works. Adding a font-weight: bold; for the inline css can make the fake optgroup more readable against whatever background. I'll keep this trick in mind if I end up adding optgroups before the issue is fixed.
1623876601
XophRA
Pro
Marketplace Creator
Sheet Author
This is all very disturbing. I hope they manage to fix this before it propagates to the active sheets.
1623877298
vÍnce
Pro
Sheet Author
Haven't tested, but it may just be a current limitation of the custom/sandbox environment and may very well work on the live/main server. ie the Freespacer example.&nbsp; Still, makes it rather difficult for sheet authors.&nbsp; Very similar to how the sheet.json used to be handled.
1623877431
XophRA
Pro
Marketplace Creator
Sheet Author
It worked in the sandbox up until recently.&nbsp;
1623877496
vÍnce
Pro
Sheet Author
XophRA said: It worked in the sandbox up until recently.&nbsp; No doubt.