first commit
This commit is contained in:
2
frontend/node_modules/antd/es/input/hooks/useRemovePasswordTimeout.d.ts
generated
vendored
Normal file
2
frontend/node_modules/antd/es/input/hooks/useRemovePasswordTimeout.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import type { InputRef } from '../Input';
|
||||
export default function useRemovePasswordTimeout(inputRef: React.RefObject<InputRef | null>, triggerOnMount?: boolean): () => void;
|
||||
23
frontend/node_modules/antd/es/input/hooks/useRemovePasswordTimeout.js
generated
vendored
Normal file
23
frontend/node_modules/antd/es/input/hooks/useRemovePasswordTimeout.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
import { useEffect, useRef } from 'react';
|
||||
export default function useRemovePasswordTimeout(inputRef, triggerOnMount) {
|
||||
const removePasswordTimeoutRef = useRef([]);
|
||||
const removePasswordTimeout = () => {
|
||||
removePasswordTimeoutRef.current.push(setTimeout(() => {
|
||||
var _a, _b, _c, _d;
|
||||
if (((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input) && ((_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.input.getAttribute('type')) === 'password' && ((_c = inputRef.current) === null || _c === void 0 ? void 0 : _c.input.hasAttribute('value'))) {
|
||||
(_d = inputRef.current) === null || _d === void 0 ? void 0 : _d.input.removeAttribute('value');
|
||||
}
|
||||
}));
|
||||
};
|
||||
useEffect(() => {
|
||||
if (triggerOnMount) {
|
||||
removePasswordTimeout();
|
||||
}
|
||||
return () => removePasswordTimeoutRef.current.forEach(timer => {
|
||||
if (timer) {
|
||||
clearTimeout(timer);
|
||||
}
|
||||
});
|
||||
}, []);
|
||||
return removePasswordTimeout;
|
||||
}
|
||||
Reference in New Issue
Block a user