Asking this question again, but differently. ;) How do I achieve the drop-down functionality found in the repeating item sections of the D&D 5e character sheet? More specifically, where the gear icon is clicked and a hidden block of stuff is displayed for editing, pushing the rest of the list contents downward while the hidden div is open? HTML <fieldset class="repeating_armor">
<select name="attr_armor_type">
<option value="-1">select...</option>
<option value="0">Clothing Only</option>
<option value="1">Hide and Fur Armor</option>
<option value="2">Leather Armor</option>
<option value="3">Ring Mail or Scale Armor</option>
<option value="4">Chain Mail Armor</option>
<option value="5">Banded Plate or Lamellar Armor</option>
<option value="6">Plate Armor</option>
<option value="7">Shield</option>
</select>
<div class="repeating-name-value-span"><label>AC:</label> <span name="attr_armor_ac">0</span></div>
<div class="repeating-name-value-span"><label>Bonus:</label> <input type="number" name="attr_armor_magic_bonus"/></div>
<div class="repeating-name-value-span"><label>Enc:</label> <span name="attr_armor_enc">0</span></div>
<button type="action" class="pictos-gear" name="act_details">y</button>
<input type="hidden" class="armor-show-details" value="0" name="attr_armor_show_details"/>
<div class="show-hide"><textarea name="attr_armor_details"></textarea></div>
</fieldset> Sheet worker script on("clicked:repeating_armor:details", function(eventInfo) {
getAttrs(["repeating_armor_armor_show_details"], function(values) {
const currentValue = parseInt(values.repeating_armor_armor_show_details)||0;
const newValue = (currentValue == 1) ? 0 : 1;
setAttrs({repeating_armor_armor_show_details : newValue});
});
}); CSS div.sheet-show-hide {
display: block;
}
input.sheet-armor-show-details[value="0"] ~ div.sheet-show-hide {
display: none;
} Everything works, except the toggled div is displayed under subsequent repeating items - I either need it on top or have it push the remaining page elements downwards. Since the D&D 5e sheet does this, I assume I'm able to do the same, but I can't figure out how.