Skip to content

Commit 2f89fec

Browse files
committed
fix(input): 不传入 name 时多个输入框表现异常
1 parent c601ebf commit 2f89fec

File tree

1 file changed

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

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ export default class AtInput extends React.Component<AtInputProps> {
147147
})
148148
const placeholderCls = classNames('placeholder', placeholderClass)
149149

150+
const id = name && { id: name }
150151
return (
151152
<View className={rootCls} style={customStyle}>
152153
<View className={containerCls}>
@@ -163,7 +164,7 @@ export default class AtInput extends React.Component<AtInputProps> {
163164
)}
164165
<Input
165166
className='at-input__input'
166-
id={name}
167+
{...id}
167168
name={name}
168169
type={type}
169170
password={password}

0 commit comments

Comments
 (0)