I’m using several add-ons to auto-fill certain fields in the editor window, which works using the editFocusLost hook: I type in the first line, press tab, several fields are filled in.
My problem is that if the first line is a duplicate, if I click the “show duplicates” link then due to loss of focus, the auto-filling takes place, so when I’m done looking at the original and want to go back to adding cards, I now need to manually erase all the filled-in fields plus the first line.
Ideally I would like all fields to reset when I click the “show duplicates” link. I might be able to create an add-on to accomplish that, but I can’t figure out what hook I should append to.
Another option would be, in each add-on (I’m using three) to modify behavior to not auto-fill if first line is a duplicate, but I don’t know how to check this condition.
Alternatively, if there’s a simpler solution I’m missing, please let me know. Closing and reopening the editor menu is not a good solution because a. it requires the extra step of confirming loss of input data, and b. I then need to re-enter the tags I’m currently using.