Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

feat(base/ui): added autofocus prop

Calin-Teodor69e0a3752984
diff --git a/react/features/base/ui/components/types.ts b/react/features/base/ui/components/types.ts
index 23e0684af2..b27b5ade69 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 72c469bdce..367b959fe9 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<any, any>(({
accessibilityLabel,
+ autoFocus = false,
className,
disabled,
fullWidth,
@@ -197,6 +198,7 @@ const Button = React.forwardRef<any, any>(({
return (
<button
aria-label = { accessibilityLabel }
+ autoFocus = { autoFocus }
className = { cx(styles.button, styles[type],
disabled && styles.disabled,
icon && !(labelKey || label) && `${styles.iconButton} iconButton`,
diff --git a/react/features/chat/components/web/Chat.js b/react/features/chat/components/web/Chat.js
index 8f61220c8e..b31ef02a4b 100644
--- a/react/features/chat/components/web/Chat.js
+++ b/react/features/chat/components/web/Chat.js
@@ -162,9 +162,7 @@ class Chat extends AbstractChat<Props> {
<MessageContainer
messages = { this.props._messages } />
<MessageRecipient />
-
<ChatInput
- onResize = { this._onChatInputResize }
onSend = { this._onSendMessage } />
</div>
</>
diff --git a/react/features/polls/components/web/PollsPane.tsx b/react/features/polls/components/web/PollsPane.tsx
index 7f58bcc205..cc9e60b9b0 100644
--- a/react/features/polls/components/web/PollsPane.tsx
+++ b/react/features/polls/components/web/PollsPane.tsx
@@ -24,6 +24,7 @@ const PollsPane = (props: AbstractProps) => {
<div className = 'poll-footer poll-create-footer'>
<Button
accessibilityLabel = { t('polls.create.create') }
+ autoFocus = { true }
fullWidth = { true }
labelKey = { 'polls.create.create' }
onClick = { onCreate } />