mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Fix autofocus for input and textarea (#6986)
This commit is contained in:
@@ -661,14 +661,33 @@ ReactDOMComponent.Mixin = {
|
||||
inputPostMount,
|
||||
this
|
||||
);
|
||||
if (props.autoFocus) {
|
||||
transaction.getReactMountReady().enqueue(
|
||||
AutoFocusUtils.focusDOMComponent,
|
||||
this
|
||||
);
|
||||
}
|
||||
break;
|
||||
case 'textarea':
|
||||
transaction.getReactMountReady().enqueue(
|
||||
textareaPostMount,
|
||||
this
|
||||
);
|
||||
if (props.autoFocus) {
|
||||
transaction.getReactMountReady().enqueue(
|
||||
AutoFocusUtils.focusDOMComponent,
|
||||
this
|
||||
);
|
||||
}
|
||||
break;
|
||||
case 'select':
|
||||
if (props.autoFocus) {
|
||||
transaction.getReactMountReady().enqueue(
|
||||
AutoFocusUtils.focusDOMComponent,
|
||||
this
|
||||
);
|
||||
}
|
||||
break;
|
||||
case 'button':
|
||||
if (props.autoFocus) {
|
||||
transaction.getReactMountReady().enqueue(
|
||||
|
||||
Reference in New Issue
Block a user