From 404818bcdfd86b4042c606ed53d5f9c83028bec4 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Fri, 13 May 2022 23:28:12 -0500 Subject: [PATCH] toolbar: use roving focus --- src/toolbar/ActionButton.tsx | 12 +++++-- src/toolbar/OpenFileButton.tsx | 12 +++++-- src/toolbar/Toolbar.tsx | 34 ++++++++++++++----- .../buttons/bluetooth/BluetoothButton.tsx | 9 +++-- src/toolbar/buttons/flash/FlashButton.tsx | 7 ++-- src/toolbar/buttons/repl/ReplButton.tsx | 7 ++-- src/toolbar/buttons/run/RunButton.tsx | 7 ++-- src/toolbar/buttons/stop/StopButton.tsx | 7 ++-- 8 files changed, 70 insertions(+), 25 deletions(-) diff --git a/src/toolbar/ActionButton.tsx b/src/toolbar/ActionButton.tsx index 1d29396b..86a6fca9 100644 --- a/src/toolbar/ActionButton.tsx +++ b/src/toolbar/ActionButton.tsx @@ -3,14 +3,14 @@ import { Button, - IRef, Intent, Spinner, SpinnerSize, + mergeRefs, useHotkeys, } from '@blueprintjs/core'; import { Tooltip2 } from '@blueprintjs/popover2'; -import React, { useEffect, useMemo, useState } from 'react'; +import React, { RefObject, useEffect, useMemo, useState } from 'react'; import { tooltipDelay } from '../app/constants'; const smallScreenThreshold = 700; @@ -30,6 +30,8 @@ export interface ActionButtonProps { readonly showProgress?: boolean; /** The progress value (0 to 1) or undefined for indeterminate progress. */ readonly progress?: number; + /** Reference to the