feat(base/ui): added autofocus prop
This commit is contained in:
parent
bfa88f13dc
commit
69e0a37529
|
@ -9,6 +9,11 @@ export interface ButtonProps {
|
||||||
*/
|
*/
|
||||||
accessibilityLabel?: string;
|
accessibilityLabel?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether or not the button should automatically focus.
|
||||||
|
*/
|
||||||
|
autoFocus?: boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether or not the button is disabled.
|
* Whether or not the button is disabled.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -178,6 +178,7 @@ const useStyles = makeStyles()((theme: Theme) => {
|
||||||
|
|
||||||
const Button = React.forwardRef<any, any>(({
|
const Button = React.forwardRef<any, any>(({
|
||||||
accessibilityLabel,
|
accessibilityLabel,
|
||||||
|
autoFocus = false,
|
||||||
className,
|
className,
|
||||||
disabled,
|
disabled,
|
||||||
fullWidth,
|
fullWidth,
|
||||||
|
@ -197,6 +198,7 @@ const Button = React.forwardRef<any, any>(({
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
aria-label = { accessibilityLabel }
|
aria-label = { accessibilityLabel }
|
||||||
|
autoFocus = { autoFocus }
|
||||||
className = { cx(styles.button, styles[type],
|
className = { cx(styles.button, styles[type],
|
||||||
disabled && styles.disabled,
|
disabled && styles.disabled,
|
||||||
icon && !(labelKey || label) && `${styles.iconButton} iconButton`,
|
icon && !(labelKey || label) && `${styles.iconButton} iconButton`,
|
||||||
|
|
|
@ -162,9 +162,7 @@ class Chat extends AbstractChat<Props> {
|
||||||
<MessageContainer
|
<MessageContainer
|
||||||
messages = { this.props._messages } />
|
messages = { this.props._messages } />
|
||||||
<MessageRecipient />
|
<MessageRecipient />
|
||||||
|
|
||||||
<ChatInput
|
<ChatInput
|
||||||
onResize = { this._onChatInputResize }
|
|
||||||
onSend = { this._onSendMessage } />
|
onSend = { this._onSendMessage } />
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
|
|
@ -24,6 +24,7 @@ const PollsPane = (props: AbstractProps) => {
|
||||||
<div className = 'poll-footer poll-create-footer'>
|
<div className = 'poll-footer poll-create-footer'>
|
||||||
<Button
|
<Button
|
||||||
accessibilityLabel = { t('polls.create.create') }
|
accessibilityLabel = { t('polls.create.create') }
|
||||||
|
autoFocus = { true }
|
||||||
fullWidth = { true }
|
fullWidth = { true }
|
||||||
labelKey = { 'polls.create.create' }
|
labelKey = { 'polls.create.create' }
|
||||||
onClick = { onCreate } />
|
onClick = { onCreate } />
|
||||||
|
|
Loading…
Reference in New Issue