We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e954204 commit 6693d9aCopy full SHA for 6693d9a
src/lib/index.jsx
@@ -143,16 +143,12 @@ class OtpInput extends Component<Props, State> {
143
144
getPlaceholderValue = () => {
145
const { placeholder, numInputs } = this.props;
146
- if (placeholder !== undefined) {
147
- if (typeof placeholder !== 'string') {
148
- console.error('Placeholder should be a string');
149
- return;
150
- }
151
-
+ if (typeof placeholder === 'string') {
152
if (placeholder.length === 1) return placeholder.repeat(numInputs);
153
else if (placeholder.length === numInputs) return placeholder;
154
else console.error('Invalid placeholder value');
155
}
+ return;
156
};
157
158
// Helper to return OTP from input
0 commit comments