Fix autofocus for input and textarea (#6986)

(cherry picked from commit eb705d1448)
This commit is contained in:
Jim authored and Paul O’Shannessy committed 2016-06-14 15:50:32 -07:00
1 parent 7a4aef0d0d
commit 07389fd9fc
1 file changed
+20 -1
+20 -1
View File
@@ -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,