mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +00:00
Fix autofocus for input and textarea (#6986)
(cherry picked from commit eb705d1448)
This commit is contained in:
1 parent
7a4aef0d0d
commit
07389fd9fc
1 file changed
+20
-1
@@ -654,15 +654,34 @@ 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':
|
||||
case 'select':
|
||||
if (props.autoFocus) {
|
||||
transaction.getReactMountReady().enqueue(
|
||||
AutoFocusUtils.focusDOMComponent,
|
||||
|
||||
Reference in new issue
Block a user