Skip to content

Commit

Permalink
Address 5737 by switching from MouseTrigger.Click to `MouseTrigger.…
Browse files Browse the repository at this point in the history
…MouseDown` because VSCode Notebook Editor eats `onClick` events. (#5834)

### Description

This PR addresses #5737 by
switching the mouse trigger of `ActionBarButton`s from
`MouseTrigger.Click` to `MouseTrigger.MouseDown`. This was necessitated
because the VSCode Notebook Editor eats `onClick` events.

### QA Notes

None at the moment.
  • Loading branch information
softwarenerd authored Dec 19, 2024
1 parent dbcb3b6 commit e6a1165
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import './actionBarButton.css';
import React, { useRef, PropsWithChildren, useImperativeHandle, forwardRef } from 'react';

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

/**
* ActionBarButtonProps interface.
Expand Down Expand Up @@ -120,6 +120,7 @@ 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 @@ -141,6 +142,7 @@ 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 @@ -153,6 +155,7 @@ 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

0 comments on commit e6a1165

Please sign in to comment.