This is fixed.
There were two problems at play here. The first is that we weren't hiding "edit" button, or really the whole comment.
Backstory: We are in the process of moving to a structured design system called Stacks which includes atomic classes like d-block
and d-none
. These classes are meant to act as overrides of component styles and have !important
on them. Unfortunately, this doesn't play well with jQuery's $.fn.css
-based functions, like $.fn.hide
.
What happened: Someone was editing the comment HTML, saw a stray style="display: block"
on a div, and changed it do class="d-block"
. Then when you clicked on "edit", the bravest JavaScript in the world, jComment.find(" > * > *").not(jForm).hide();
, tried hiding the element and failed, because !important
is important!
The fix: I just reverted that line of code. A thought out restructuring of the JavaScript is probably more appropriate, but there are already plans to overhaul the comment UI so I'm just going to wait for that to do JavaScript changes.
The second problem was why you got so many edit fields, ΣN of them where N is the number of clicks. Assuming someone is going to break thing again, we've got to fix that.
What happened: This problem was less nuanced. The comment.edit
function just wasn't idempotent, so calling it multiple times yielded multiple inputs. The increasing number of fields is because we do two inserts, first we insert the new container, then we insert inputs, and the second insert was matching both the new and the old containers.
The fix: I just checked to see if the input was already there before adding it again.
status-by-design
.