From f670d5a8b7f05a47ca06947682866f6f1e20f704 Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Fri, 20 Nov 2026 14:33:56 +0100 Subject: [PATCH] fix(edit): keep focus and the open menu right when reordering options After an option is moved, the move-up/move-down buttons change their disabled state, NcActions re-renders and then moves focus to its first action unless one of its items is marked active. The previous code also focused the action's
  • wrapper instead of its button. Focus the button and mark its item active, so focus stays on the button that was used (or the other one once the option reaches the top or bottom). The move menu is rendered inside the option's list item. While the options animate into their new order, every moving item gets a transform and so its own stacking context, and the items after the one with the open menu were painted over the menu. Lift the list item above its siblings while its menu is open. The ranked list that respondents reorder in a ranking question had the same two problems and gets the same fixes. It also looked the move buttons up by position in refs that Vue keeps in mount order, so after a reorder it could focus another item's button; look them up by option id instead. The focus handling is shared in FocusActionItem.ts. Fixes #2595 Co-authored-by: Himanshu Bhardwaj Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Himanshu Bhardwaj Signed-off-by: Andy Scherzinger --- src/components/Questions/AnswerInput.vue | 15 ++- src/components/Questions/QuestionRanking.vue | 100 ++++++++++++------- src/utils/FocusActionItem.ts | 22 ++++ 3 files changed, 101 insertions(+), 36 deletions(-) create mode 100644 src/utils/FocusActionItem.ts diff --git a/src/components/Questions/AnswerInput.vue b/src/components/Questions/AnswerInput.vue index 9181f22ff..e498f8c3b 100644 --- a/src/components/Questions/AnswerInput.vue +++ b/src/components/Questions/AnswerInput.vue @@ -4,7 +4,10 @@ -->