From e9796c9a35c41f302bbbcc860ece2550f67c10b9 Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Fri, 21 Nov 2025 01:29:54 +0200 Subject: [PATCH] client/note color picker: fix the custom color picker on Safari --- apps/client/src/menus/custom-items/NoteColorPicker.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/client/src/menus/custom-items/NoteColorPicker.tsx b/apps/client/src/menus/custom-items/NoteColorPicker.tsx index 06ae6dc96..9a65073a7 100644 --- a/apps/client/src/menus/custom-items/NoteColorPicker.tsx +++ b/apps/client/src/menus/custom-items/NoteColorPicker.tsx @@ -122,6 +122,7 @@ function CustomColorCell(props: ColorCellProps) { const colorInput = useRef(null); const colorInputDebouncer = useRef | null>(null); const callbackRef = useRef(props.onSelect); + const isSafari = useRef(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)); useEffect(() => { colorInputDebouncer.current = new Debouncer(500, (color) => { @@ -152,7 +153,12 @@ function CustomColorCell(props: ColorCellProps) { colorInput.current?.click(); }, [pickedColor]); - return
+ return
{ + // The color picker dropdown will close on Safari if the parent context menu is + // dismissed, so stop the click propagation to prevent dismissing the menu. + isSafari.current && e.stopPropagation(); + }}>