Skip to content

Commit 3538c3d

Browse files
committed
fix: 解决 input 组件 focus 状态丢失的问题
#1463
1 parent da406aa commit 3538c3d

File tree

1 file changed

+3
-3
lines changed
  • packages/taro-ui/src/components/input

1 file changed

+3
-3
lines changed

packages/taro-ui/src/components/input/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ export default class AtInput extends React.Component<AtInputProps> {
124124
placeholder,
125125
placeholderStyle,
126126
placeholderClass,
127-
autoFocus,
128-
focus,
127+
autoFocus = false,
128+
focus = false,
129129
value,
130130
required
131131
} = this.props
@@ -174,7 +174,7 @@ export default class AtInput extends React.Component<AtInputProps> {
174174
cursorSpacing={cursorSpacing}
175175
maxlength={maxlength}
176176
autoFocus={autoFocus}
177-
focus={focus}
177+
{...(focus ? { focus } : {})}
178178
value={value}
179179
confirmType={confirmType}
180180
cursor={cursor}

0 commit comments

Comments
 (0)