mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 01:23:52 +00:00
utils: drop pointerEventsNone
Not sure why this was used in the first place, but causes non-default behavior which can be confusing.
This commit is contained in:
@@ -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<ActionButtonProps> = ({
|
||||
intent={Intent.PRIMARY}
|
||||
onClick={onAction}
|
||||
disabled={enabled === false}
|
||||
style={enabled === false ? pointerEventsNone : undefined}
|
||||
>
|
||||
{showProgress ? (
|
||||
<Spinner
|
||||
@@ -115,7 +113,6 @@ const ActionButton: React.VoidFunctionComponent<ActionButtonProps> = ({
|
||||
height={`${buttonSize}px`}
|
||||
src={icon}
|
||||
alt={label}
|
||||
style={pointerEventsNone}
|
||||
/>
|
||||
)}
|
||||
</Button>
|
||||
|
||||
@@ -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<OpenFileButtonProps> = ({
|
||||
'aria-haspopup': undefined,
|
||||
intent: Intent.PRIMARY,
|
||||
disabled: enabled === false,
|
||||
style: enabled === false ? pointerEventsNone : undefined,
|
||||
onClick: onClick,
|
||||
})}
|
||||
>
|
||||
@@ -132,7 +130,6 @@ const OpenFileButton: React.VoidFunctionComponent<OpenFileButtonProps> = ({
|
||||
height={`${buttonSize}px`}
|
||||
src={icon}
|
||||
alt={label}
|
||||
style={pointerEventsNone}
|
||||
/>
|
||||
)}
|
||||
</Button>
|
||||
|
||||
+1
-4
@@ -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();
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user