I have a multiline input in a RepeatingGroup of comments. Essentially a list of comments from many users, where users can hit the edit button on comments if they are the author.
I would really like so that if a user types something in the multiline input, but switches to a different cell without intending to save, that their “draft” content doesn’t remain when switching back to the original cell.
I don’t want autobinding on, because I have save/cancel buttons so that the user can decide whether or not to submit their changes.
I have a custom state tied to an Edit button, to toggle the display of the text vs the multline input in that cell. In this case (and generally for RepeatingGroups), I make the custom state “editing_comment” of data type Comment, so that if the user hits an edit button on one RG cell, it’ll only ever have one RG cell in “editing mode” at a time. (I hate when simple UIs get cluttered with a bunch of undesired inputs left open).
Normally this is simple to accomplish in standard groups (not RGs) where I just have a workflow to reset the group containing the input if the user decides to switch to editing another thing without wanting to save. But in the RG/multiline input case, the user is hitting “edit” on a different cell, so resetting the Group with the multiline input would be be referencing the instance of that group in the new cell, not the old one.
And when going back to a cell with a “discarded draft,” the multiline inputs maintain the draft text, despite the Initial Content being set to the actual DB data of the Comment content.
Looking back, I think this issue of leaving inputs in their draft state applies to all inputs in RGs in general, not just the multiline input element.