From 7322c9d667f973c015ba5dc357cdad59caf6e721 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Fri, 13 May 2022 14:39:35 -0500 Subject: [PATCH] utils: drop pointerEventsNone Not sure why this was used in the first place, but causes non-default behavior which can be confusing. --- src/toolbar/ActionButton.tsx | 3 --- src/toolbar/OpenFileButton.tsx | 3 --- src/utils/react.ts | 5 +---- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/toolbar/ActionButton.tsx b/src/toolbar/ActionButton.tsx index 524dc8f4..64771e8d 100644 --- a/src/toolbar/ActionButton.tsx +++ b/src/toolbar/ActionButton.tsx @@ -12,7 +12,6 @@ import { import { Tooltip2 } from '@blueprintjs/popover2'; import React, { useEffect, useMemo, useState } from 'react'; import { tooltipDelay } from '../app/constants'; -import { pointerEventsNone } from '../utils/react'; const smallScreenThreshold = 700; @@ -101,7 +100,6 @@ const ActionButton: React.VoidFunctionComponent = ({ intent={Intent.PRIMARY} onClick={onAction} disabled={enabled === false} - style={enabled === false ? pointerEventsNone : undefined} > {showProgress ? ( = ({ height={`${buttonSize}px`} src={icon} alt={label} - style={pointerEventsNone} /> )} diff --git a/src/toolbar/OpenFileButton.tsx b/src/toolbar/OpenFileButton.tsx index 20c283d3..78db8aea 100644 --- a/src/toolbar/OpenFileButton.tsx +++ b/src/toolbar/OpenFileButton.tsx @@ -6,7 +6,6 @@ import { Tooltip2 } from '@blueprintjs/popover2'; import React, { useEffect, useState } from 'react'; import { useDropzone } from 'react-dropzone'; import { tooltipDelay } from '../app/constants'; -import { pointerEventsNone } from '../utils/react'; const smallScreenThreshold = 700; export interface OpenFileButtonProps { @@ -115,7 +114,6 @@ const OpenFileButton: React.VoidFunctionComponent = ({ 'aria-haspopup': undefined, intent: Intent.PRIMARY, disabled: enabled === false, - style: enabled === false ? pointerEventsNone : undefined, onClick: onClick, })} > @@ -132,7 +130,6 @@ const OpenFileButton: React.VoidFunctionComponent = ({ height={`${buttonSize}px`} src={icon} alt={label} - style={pointerEventsNone} /> )} diff --git a/src/utils/react.ts b/src/utils/react.ts index ca54ef00..7f681433 100644 --- a/src/utils/react.ts +++ b/src/utils/react.ts @@ -1,11 +1,8 @@ // helper functions for React components -import React, { useState } from 'react'; +import { useState } from 'react'; import { createCountFunc } from './iter'; -/** Style to disable pointer events. */ -export const pointerEventsNone: React.CSSProperties = { pointerEvents: 'none' }; - const nextId = createCountFunc(); /**