File tree Expand file tree Collapse file tree
apps/showcase/demo/inputotp
packages/headless/src/inputotp Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ) ;
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { MinusIcon } from '@primereact/icons';
22import { InputOtpInstance } from '@primereact/types/shared/inputotp' ;
33import { Button } from 'primereact/button' ;
44import { InputOtp } from 'primereact/inputotp' ;
5+ import * as React from 'react' ;
56
67export 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 </ >
Original file line number Diff line number Diff 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 ] ) ;
You can’t perform that action at this time.
0 commit comments