Skip to content

Commit

Permalink
Fix autofocus for input and textarea (facebook#6986)
Browse files Browse the repository at this point in the history
(cherry picked from commit eb705d1)
  • Loading branch information
jimfb authored and zpao committed Jun 8, 2016
1 parent bdfb3e7 commit df578b9
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/renderers/dom/shared/ReactDOMComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -654,14 +654,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(
Expand Down

0 comments on commit df578b9

Please sign in to comment.