From ba9155a9af60f0f864f154a891fc75f39c01b1fc Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Wed, 1 Oct 2025 13:44:16 -0600 Subject: [PATCH] prevent focus capture from segmented --- .../features/input/BusterChatInput/BusterChatInputButtons.tsx | 1 + .../MentionInputSuggestions/MentionInputSuggestions.tsx | 1 + apps/web/src/components/ui/popover/Popover.tsx | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/web/src/components/features/input/BusterChatInput/BusterChatInputButtons.tsx b/apps/web/src/components/features/input/BusterChatInput/BusterChatInputButtons.tsx index 99b87ce17..f6b81cfb9 100644 --- a/apps/web/src/components/features/input/BusterChatInput/BusterChatInputButtons.tsx +++ b/apps/web/src/components/features/input/BusterChatInput/BusterChatInputButtons.tsx @@ -166,6 +166,7 @@ const ModePopoverContent = ({ side="bottom" sideOffset={10} className="p-0" + onOpenAutoFocus={(e) => e.preventDefault()} content={
diff --git a/apps/web/src/components/ui/inputs/MentionInputSuggestions/MentionInputSuggestions.tsx b/apps/web/src/components/ui/inputs/MentionInputSuggestions/MentionInputSuggestions.tsx index 54ff9ceb4..b55292cb6 100644 --- a/apps/web/src/components/ui/inputs/MentionInputSuggestions/MentionInputSuggestions.tsx +++ b/apps/web/src/components/ui/inputs/MentionInputSuggestions/MentionInputSuggestions.tsx @@ -95,6 +95,7 @@ export const MentionInputSuggestions = forwardRef< const onSelectItem = useMemoizedFn( ({ onClick, ...params }: MentionInputSuggestionsOnSelectParams) => { const { addValueToInput, loading, label, disabled, inputValue } = params; + console.log('onSelectItem', params); if (disabled) { console.warn('Item is disabled', params); return; diff --git a/apps/web/src/components/ui/popover/Popover.tsx b/apps/web/src/components/ui/popover/Popover.tsx index 9a4a1a27f..d0661c02b 100644 --- a/apps/web/src/components/ui/popover/Popover.tsx +++ b/apps/web/src/components/ui/popover/Popover.tsx @@ -9,7 +9,7 @@ import { export interface PopoverProps extends React.ComponentProps, - Pick, 'align' | 'side'> { + Pick, 'align' | 'side' | 'onOpenAutoFocus'> { children: React.ReactNode; content: React.ReactNode; className?: string; @@ -28,6 +28,7 @@ export const Popover = React.memo( trigger = 'click', size = 'default', sideOffset, + onOpenAutoFocus, ...props }) => { return ( @@ -41,6 +42,7 @@ export const Popover = React.memo( className={className} size={size} sideOffset={sideOffset} + onOpenAutoFocus={onOpenAutoFocus} > {content}