On the File page, going through the steps to add a new Qualifier to an existing statement, and then aborting that step, leaves behind a visible trace on the page.
Steps to Reproduce:
- Go to a File page and view the Structured Data tab. This bug is viewable on both BetaCommons and on master. Using a Statement Panel which already contains one or more statements will make this easier to see.
- Toggle a Statement panel into edit mode, and click the "Add Qualifier" button
- Do not actually submit a new qualifier; instead, click the Cancel button.
- (optional): Repeat this an arbitrary number of times.
Actual Results:
Each time the user toggles the qualifier input UI and then cancels it, something is left behind that confuses the panel. These "ghost qualifiers" were never submitted to the server and have no content... but you can see them.
In Read mode, you can see one "ghost qualifier" for each cancelled attempt that was made (note the little lines and weird spacing):
In Edit mode, the ghost qualifiers come back with a vengeance, and show up as full (empty, disabled) rows. They are there from the moment the panel becomes editable and persist between mode switches:
Expected Results:
If the user clicks "add qualifier" but then cancels without submitting new data, the DOM should revert to the same state that it was in before when it returns to read mode. If the user toggles back into edit mode again at this point, there should be no extra empty input rows visible.