Skip to content

Commit

Permalink
Readdress 5737 fixing the actual cause
Browse files Browse the repository at this point in the history
  • Loading branch information
softwarenerd committed Jan 6, 2025
1 parent 2bc1b74 commit 3af5733
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import React, { useRef, PropsWithChildren, useImperativeHandle, forwardRef } fro

// Other dependencies.
import { usePositronActionBarContext } from '../positronActionBarContext.js';
import { Button, MouseTrigger } from '../../../../base/browser/ui/positronComponents/button/button.js';
import { Button } from '../../../../base/browser/ui/positronComponents/button/button.js';
import { optionalBoolean, optionalValue, positronClassNames } from '../../../../base/common/positronUtilities.js';

/**
Expand Down Expand Up @@ -120,7 +120,6 @@ export const ActionBarButton = forwardRef<
ariaLabel={ariaLabel}
tooltip={props.tooltip}
disabled={props.disabled}
mouseTrigger={MouseTrigger.MouseDown}
onMouseEnter={props.onMouseEnter}
onMouseLeave={props.onMouseLeave}
onPressed={props.onPressed}
Expand All @@ -142,7 +141,6 @@ export const ActionBarButton = forwardRef<
ariaLabel={ariaLabel}
tooltip={props.tooltip}
disabled={props.disabled}
mouseTrigger={MouseTrigger.MouseDown}
onMouseEnter={props.onMouseEnter}
onMouseLeave={props.onMouseLeave}
onPressed={props.onPressed}
Expand All @@ -155,7 +153,6 @@ export const ActionBarButton = forwardRef<
className='action-bar-button-drop-down-button'
ariaLabel={props.dropdownAriaLabel}
tooltip={props.dropdownTooltip}
mouseTrigger={MouseTrigger.MouseDown}
onPressed={props.onDropdownPressed}
>
<div className='action-bar-button-drop-down-arrow codicon codicon-positron-drop-down-arrow' />
Expand Down
9 changes: 9 additions & 0 deletions src/vs/workbench/browser/parts/editor/editorGroupView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,15 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
target = (e as GestureEvent).initialTarget as HTMLElement;
}

// --- Start Positron ---
// Do not focus the editor if the event is for a Positron action bar. This addresses
// https://github.com/posit-dev/positron/issues/5737 and was borrowed from the code
// below.
if (findParentWithClass(target, 'positron-action-bar', this.titleContainer)) {
return;
}
// --- End Positron ---

if (findParentWithClass(target, 'monaco-action-bar', this.titleContainer) ||
findParentWithClass(target, 'monaco-breadcrumb-item', this.titleContainer)
) {
Expand Down

0 comments on commit 3af5733

Please sign in to comment.