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

(Custom Sheet) Action Buttons in repeating sections suddenly not working

Hello all! Long-time player, first-time poster. Just a disclaimer, first up: I'm still pretty much a novice with HTML/CSS, and this whole issue is probably some dumb problem of my own making. But I'm at kind of a loss to figure out a solution, so hopefully someone else can see where I went wrong here and put me on the right track. I recently made a custom sheet to use for a Cortex Prime-based game I'm going to be running. I finished it a couple of weeks ago, and everything seemed to be completely normal and functional: I even used the sheets to make a few sample characters for my players to browse through. Fast-forward to the other night. I was doing prep, getting ready for our first real session, and I noticed something concerning: pretty much all the action buttons in my repeating sections have ceased to function. The CSS all still works--they still light up like they're designed to when hovered, clicked, etc; but the action button itself doesn't do anything--nothing at all pops up in the console, so it's not like it's the sheetworkers themselves kicking out errors. In a way, I think I kind of understand the source of the issue. I know that action buttons in repeating sections have trouble when they're given relative positioning in the CSS, which I *thought* I had worked around by leaving them static (in fact, being pretty specific in my CSS to *make* them all static), but putting them inside a <div> element that was, itself, relative. What has me stumped is: what changed? My code sure didn't. Has Roll20 had an update that changes how it handles these things recently? Has this happened to anyone else, and does anyone know of a way around it, other than just entirely overhauling my repeating sections? Just in case it helps, here are some additional clarifying points: • I'm not using Jumpgate, just the regular old VTT. • I've tried both copying the original game and starting an entirely new game using the same sheet code; no joy. • I did also try re-uploading the code from my local saved copy into the same game as well, just in case something had gotten corrupted; also no result. • It is JUST my repeating sections; all my non-repeating action buttons, and pretty much everything else about the sheet, still seems to work as intended.
1715382804
GiGs
Pro
Sheet Author
API Scripter
It's hard to guess without seeing the code for your repeating section. I'm not aware of any change to roll20 character shets, but errors in sheet worker code can be like this sometimes: they work for a while then stop working, and the fact they used to work baffled you. Then you learn about the error and realise they shouldn't have worked at all. So you shrug and move on with the error fixed. But we need to see the code to guss at the error.
Good point. Here's a snippet of my code with a pretty typical example, a button that appears all over the place on my sheet for hiding/revealing stuff: HTML: <fieldset class="repeating_asset"> <div class="distinction-container"> <!-- A couple of hidden inputs containing the repeating section's row ID, something I use a lot in my workers, and the flag for showing/hiding the section's body. Can't imagine they'd be relevant, but what do I know? --> <input type="hidden" name="attr_row-id" id="row-id" value="0"> <input type="hidden" id="show-hide" name="attr_toggle_asset" value="0"> <!-- Container for holding the button that shows/hides the section body --> <div class="repeating-show-button"> <!-- The button itself. --> <button type="action" name="act_toggle" id="toggle_asset" class="show-switch">►</button> </div> <!-- Rest of the section normally sits here; truncated for brevity --> </div> </fieldset> ---------------------------------------------------------------------------- CSS: .show-switch { position: relative; top: -5px; width: 40px; height: 40px; z-index: 2; rotate: 90deg; text-align: left; padding-left: 6px; padding-bottom: 2px; border: 5px solid #d4d4d4; border-radius: 20px; color: #d4d4d4; background-color: #000000; } .repeating-show-button { position: relative; top: -5px; } .repeating-show-button > .show-switch { position: static; } I can include the JS for the button as well, but I don't think I need to--it gets called and functions as it should anytime those buttons appear outside of repeating sections. All my other action buttons have a similar setup as above: a <div> container that gets set as relative and moved where I need it, and the <button> inside that's explicitly marked as position: static . GiGs said: ... errors in sheet worker code can be like this sometimes: they work for a while then stop working, and the fact they used to work baffled you. Then you learn about the error and realise they shouldn't have worked at all. So you shrug and move on with the error fixed. Wouldn't surprise me in the least if this were the case here. I'm hoping not, but with the spaghetti code I churn out, it probably is. Still, never hurts to check before rewriting a good third of your project, right?
1715387431
GiGs
Pro
Sheet Author
API Scripter
Can you post the sheet worker code for the button too?
1715387839

Edited 1715388078
GiGs
Pro
Sheet Author
API Scripter
You don't need a position. It's static by default, you only need that if you have set the button to somethign else and want to reset it. I have questions: Why do you have an id on that button? You can probably delete that. Why do you have that div with the repeating-show-button class? I don't see any reason for it to be there. I would get rid of that repeating-show-button class. If you have not shown the complete code (making it harder for someone to help you), I'd rewrite that so it doesn't include position:relative. You know position is a problem for action buttons in a repeating section, so there's no reason to set a position on action buttons.