Skip to content

Commit 0aa6f0b

Browse files
chore: demo updates
1 parent b611423 commit 0aa6f0b

3 files changed

Lines changed: 3 additions & 31 deletions

File tree

apps/showcase/demo/inputotp/custom-demo.tsx

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -46,26 +46,6 @@ export default function CustomDemo() {
4646
onPaste={onPaste}
4747
/>
4848
);
49-
// return (
50-
// <input
51-
// value={state.tokens[index] ?? ''}
52-
// key={index}
53-
// type="text"
54-
// className="custom-otp-input"
55-
// onInput={(e) => {
56-
// const target = e.target as HTMLInputElement;
57-
58-
// if (target.value.length > 1) {
59-
// target.value = target.value.slice(0, 1);
60-
// }
61-
62-
// onInput(e, index);
63-
// }}
64-
// onClick={onClick}
65-
// onKeyDown={onKeyDown}
66-
// onPaste={onPaste}
67-
// />
68-
// );
6949
})}
7050
</>
7151
);

apps/showcase/demo/inputotp/sample-demo.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { MinusIcon } from '@primereact/icons';
22
import { InputOtpInstance } from '@primereact/types/shared/inputotp';
33
import { Button } from 'primereact/button';
44
import { InputOtp } from 'primereact/inputotp';
5+
import * as React from 'react';
56

67
export default function SampleDemo() {
78
return (
@@ -58,10 +59,9 @@ export default function SampleDemo() {
5859
registerText();
5960

6061
return (
61-
<>
62+
<React.Fragment key={index}>
6263
<input
6364
value={state.tokens[index] ?? ''}
64-
key={index}
6565
type="text"
6666
inputMode="text"
6767
className="custom-otp-input-sample"
@@ -76,7 +76,7 @@ export default function SampleDemo() {
7676
<MinusIcon />
7777
</div>
7878
)}
79-
</>
79+
</React.Fragment>
8080
);
8181
})}
8282
</>

packages/headless/src/inputotp/useInputOtp.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,6 @@ export const useInputOtp = withHeadless({
2929
return index;
3030
}, []);
3131

32-
// React.useEffect(() => {
33-
// textCounter.current = 0;
34-
35-
// return () => {
36-
// textCounter.current = 0;
37-
// };
38-
// }, []);
39-
4032
const inputMode = React.useCallback(() => {
4133
return props.integerOnly ? 'numeric' : 'text';
4234
}, [props.integerOnly]);

0 commit comments

Comments
 (0)