From cf407fe8dee08b049c37e1e28e49baea80cc1c16 Mon Sep 17 00:00:00 2001 From: Joao Silva <100691367+JoaoSilvaGrafana@users.noreply.github.com> Date: Mon, 20 May 2024 10:39:52 +0100 Subject: [PATCH] Button: Allow disabled button to still be focused (#87516) --- .../src/components/Button/Button.story.tsx | 8 +++++- .../src/components/Button/Button.tsx | 28 +++++++++++++++++-- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/packages/grafana-ui/src/components/Button/Button.story.tsx b/packages/grafana-ui/src/components/Button/Button.story.tsx index 517cf9089ba..d1372d63dc5 100644 --- a/packages/grafana-ui/src/components/Button/Button.story.tsx +++ b/packages/grafana-ui/src/components/Button/Button.story.tsx @@ -1,3 +1,4 @@ +import { action } from '@storybook/addon-actions'; import { StoryFn } from '@storybook/react'; import React from 'react'; @@ -26,6 +27,9 @@ export default { tooltip: { control: 'text', }, + disabled: { + control: 'boolean', + }, className: { table: { disable: true, @@ -96,7 +100,9 @@ export const Examples: StoryFn = () => { ); }; -export const Basic: StoryFn = (args: ButtonProps) => @@ -217,7 +239,9 @@ export const getButtonStyles = (props: StyleProps) => { ':disabled': disabledStyles, '&[disabled]': disabledStyles, }), - disabled: css(disabledStyles), + disabled: css(disabledStyles, { + '&:hover': css(disabledStyles), + }), img: css({ width: '16px', height: '16px',