From ed76013e709d711d70e65583254a53120df13b98 Mon Sep 17 00:00:00 2001 From: Arnaud AMBROSELLI Date: Mon, 6 Nov 2023 11:29:35 +0100 Subject: [PATCH] =?UTF-8?q?fix(dashboard):=20quand=20on=20renomme=20un=20c?= =?UTF-8?q?hamp=20dans=20une=20liste=20de=20champs=20tr=C3=A8s=20longue,?= =?UTF-8?q?=20=C3=A7a=20jump=20et=20c'est=20frustrant=20-=20c'est=20fix?= =?UTF-8?q?=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/SelectDraggableAndEditable.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/dashboard/src/components/SelectDraggableAndEditable.js b/dashboard/src/components/SelectDraggableAndEditable.js index 84911eee5..09a08f9d7 100644 --- a/dashboard/src/components/SelectDraggableAndEditable.js +++ b/dashboard/src/components/SelectDraggableAndEditable.js @@ -61,7 +61,17 @@ const SelectDraggableAndEditable = ({ onChange, classNamePrefix, value, onEditCh aria-label={`Modifier le choix ${props.children}`} title={`Modifier le choix ${props.children}`} className={`tw-ml-2 ${classNamePrefix}__multi-value__edit tw-rounded-sm tw-px-1 hover:tw-bg-[#FFBDAD] hover:tw-text-[#DE350B]`} - onClick={() => setEditingChoice(props.children)} + onMouseDown={(e) => { + // Prevent propagation to parent components + e.stopPropagation(); + // Explicitly blur the Select input + document.querySelector(`.${classNamePrefix}__input`).blur(); + }} + onClick={(e) => { + e.stopPropagation(); + e.preventDefault(); + setEditingChoice(props.children); + }} type="button"> ✎