feat(base/ui): added autofocus prop

pull/12268/head jitsi-meet_7860
Calin-Teodor 3 years ago committed by Calinteodor
parent bfa88f13dc
commit 69e0a37529
  1. 5
      react/features/base/ui/components/types.ts
  2. 2
      react/features/base/ui/components/web/Button.tsx
  3. 2
      react/features/chat/components/web/Chat.js
  4. 1
      react/features/polls/components/web/PollsPane.tsx

@ -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.
*/

@ -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`,

@ -162,9 +162,7 @@ class Chat extends AbstractChat<Props> {
<MessageContainer
messages = { this.props._messages } />
<MessageRecipient />
<ChatInput
onResize = { this._onChatInputResize }
onSend = { this._onSendMessage } />
</div>
</>

@ -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 } />

Loading…
Cancel
Save