xfd: avoid overwriting reason when afd outcome is toggled - #2382
xfd: avoid overwriting reason when afd outcome is toggled#2382siddharthvp wants to merge 1 commit into
Conversation
| $(afdTarget).parent().hide(); | ||
| } | ||
| // Reset reason if the user hasn't modified it much | ||
| if (reason.value.endsWith('because ')) { |
There was a problem hiding this comment.
In my testing, doesn't appear to handle the blank case. That is, if a user opens the XFD -> AFD form, then selects Merging, with this patch loaded it currently fills in nothing, instead of filling in "I propose merging because". Looks like a regression that will lead to none of the reasons ever being loaded unless the user types "because " into the reason field before making their selection.
There was a problem hiding this comment.
Same bug still appears to be present in my testing. As a recap, pre-patch the behavior is to display no default reason when switching to "delete" reason, and to display a default reason when switching to "merge", "redirect", "draftify". Currently this patch never displays anything, unless the user types "because " into the reason box, then switches.
There was a problem hiding this comment.
it works for me. Can you try in safe mode?
There was a problem hiding this comment.
Like &safemode=1? Won't that disable Twinkle?
When AFD outcome dropdown is switched, reset the reason text only if it ends in "because", the same heuristic used when modifying the AFD target. Switch from jQuery to plain JS usage.
|
In addition to the complaints at WT:TW, I've seen a couple users complain about this issue in their AfD nomination statements. |
When AFD outcome dropdown is switched, reset the reason text only if it ends in "because", the same heuristic used when modifying the AFD target.
Switch from jQuery to plain JS usage.