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

Repeating fieldset attribute reset to default value when type isn't set

1511467187
vÍnce
Pro
Sheet Author
Not sure if this can be classified as a bug since you should always set the type on your inputs...  Some of the repeating attributes on the ad&d 1e sheet started being reset when interacting with other fields within that repeating row.  What's strange is that the code for this has not changed in over year yet this issue only recently cropped up.  I noticed that some of the text fields did not include a type and had value="".  It appears that simply including type="text" has rectified this problem.  I've went ahead and updated the 1e sheet to include type for all text inputs.   So this problem should be rectified in the next cycle. Was there recently a change to roll20 that forces the repeating rows to be reset to their default value?  While pertaining to sheetworkers, perhaps this is related to  [Sheet workers] Default values for repeating row inputs undefined when referring to them via rowid Thoughts?  TIA I made a small test case, one repeating section without type and another with. <h3>Fails: Repeating with null value and type not set</h3> <fieldset class="repeating_ability"> <table> <tr> <td>Name: <input name="attr_name" value="" placeholder="Ability Name" /></td> </tr> <tr> <td> Description: <textarea name="attr_description" placeholder="Ability Description" style="height:2em;"></textarea></td> </tr> </table> </fieldset> <h3>Repeating with null value and type set to text</h3> <fieldset class="repeating_ability3"> <table> <tr> <td>Name: <input name="attr_name" type="text" value="" placeholder="Ability Name" /></td> </tr> <tr> <td> Description: <textarea name="attr_description" placeholder="Ability Description" style="height:2em;"></textarea></td> </tr> </table> </fieldset> Here's the console log after changing a field within the repeating section.  // Fails: input without type. Seems to overwrite the attribute value for "name" app.js?1511368940:39 Really updating character sheet values app.js?1511368940:39 Setting up repeating sections took until 0ms app.js?1511368940:39 Finding list of dirty attributes took until 0ms app.js?1511368940:39 Querytest took until 1ms app.js?1511368940:39 Attribute cache compliation took until 1ms app.js?1511368940:39 FILLED IN A DEFAULT VALUE FOR repeating_ability_-KzeIdiZxeCdYSPxm20x_name app.js?1511368940:39 Set values (including auto-calcuating variables) took until 2ms app.js?1511368940:39 Took 2ms // Works as expected: input includes type="text" and does not overwrite the current values for name. app.js?1511368940:39 Really updating character sheet values app.js?1511368940:39 Setting up repeating sections took until 1ms app.js?1511368940:39 Finding list of dirty attributes took until 2ms app.js?1511368940:39 Querytest took until 3ms app.js?1511368940:39 Attribute cache compliation took until 3ms app.js?1511368940:39 Set values (including auto-calcuating variables) took until 6ms app.js?1511368940:39 Took 7ms
1511516760
Jakob
Sheet Author
API Scripter
I don't remember any input ever saving anything if the type wasn't set to type="text" explicitly. I'm surprised that this ever worked?
1511648519
vÍnce
Pro
Sheet Author
Update: I believe I accidently removed type="text" from some of the inputs. Ack... I have corrected my mistake and will make a pull request( <a href="https://github.com/Roll20/roll20-character-sheets/" rel="nofollow">https://github.com/Roll20/roll20-character-sheets/</a>... ) for the next update cycle. Sheet author error... Please mark as resolved.
1511660625
Gen Kitty
Forum Champion
Marking as resolved for now, but will leave this open so you can confirm everything is good, after the next update cycle.&nbsp; *patpat*&nbsp; We appreciate our sheet authors :)