#4469 Improve toolbar ux (#5841)

* Improve ActionButtonDropdown selection

* center rectangle icon fixed

* ignore Esc key when displaying hotkeys

* add ability to escape 3 point circle tool

* remove focus from ActionButton, ActionButtonDropdown

* remove focus outline from buttons

* remember lastly selected multi action item

* Add tests for toolbar buttons

* fix sketch-tests by turning toolbar dropdown arrays into an object with an id - this got broken because dropdown now remember the last selected option so we cant rely on cant reference the first option in tests

* update other tests with open menu click
This commit is contained in:
Andrew Varga
2025-04-09 14:32:52 +02:00
committed by GitHub
parent e78100eaac
commit e5f23a49b4
10 changed files with 743 additions and 621 deletions

View File

@ -71,6 +71,7 @@ export const ActionButton = forwardRef((props: ActionButtonProps, ref) => {
<button
ref={ref as ForwardedRef<HTMLButtonElement>}
className={classNames}
tabIndex={-1}
{...rest}
>
{iconStart && <ActionIcon {...iconStart} />}

View File

@ -69,6 +69,7 @@ export function ActionButtonDropdown({
close()
}}
className="group/button flex items-center gap-6 px-3 py-1 font-sans text-xs hover:bg-primary/10 dark:hover:bg-chalkboard-80 border-0 m-0 w-full rounded-none text-left disabled:!bg-transparent dark:disabled:text-chalkboard-60"
tabIndex={-1}
disabled={item.disabled}
data-testid={'dropdown-' + item.id}
>