From 69e0a375298410297919009172b13109cc371f23 Mon Sep 17 00:00:00 2001 From: Calin-Teodor Date: Thu, 29 Sep 2022 11:45:38 +0300 Subject: [PATCH] feat(base/ui): added autofocus prop --- react/features/base/ui/components/types.ts | 5 +++++ react/features/base/ui/components/web/Button.tsx | 2 ++ react/features/chat/components/web/Chat.js | 2 -- react/features/polls/components/web/PollsPane.tsx | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/react/features/base/ui/components/types.ts b/react/features/base/ui/components/types.ts index 23e0684af..b27b5ade6 100644 --- a/react/features/base/ui/components/types.ts +++ b/react/features/base/ui/components/types.ts @@ -9,6 +9,11 @@ export interface ButtonProps { */ accessibilityLabel?: string; + /** + * Whether or not the button should automatically focus. + */ + autoFocus?: boolean; + /** * Whether or not the button is disabled. */ diff --git a/react/features/base/ui/components/web/Button.tsx b/react/features/base/ui/components/web/Button.tsx index 72c469bdc..367b959fe 100644 --- a/react/features/base/ui/components/web/Button.tsx +++ b/react/features/base/ui/components/web/Button.tsx @@ -178,6 +178,7 @@ const useStyles = makeStyles()((theme: Theme) => { const Button = React.forwardRef(({ accessibilityLabel, + autoFocus = false, className, disabled, fullWidth, @@ -197,6 +198,7 @@ const Button = React.forwardRef(({ return (