Formatting
This commit is contained in:
parent
99561d0d4c
commit
1604680ab9
1 changed files with 16 additions and 14 deletions
|
|
@ -121,23 +121,25 @@ export default function InputComponent({
|
||||||
)}
|
)}
|
||||||
placeholder={password && editNode ? "Key" : placeholder}
|
placeholder={password && editNode ? "Key" : placeholder}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
// if the user copies a password from another input
|
// if the user copies a password from another input
|
||||||
// it might come as ••••••••••• it causes errors
|
// it might come as ••••••••••• it causes errors
|
||||||
// in ascii encoding, so we need to handle it
|
// in ascii encoding, so we need to handle it
|
||||||
if (password) {
|
if (password) {
|
||||||
// check if all chars are •
|
// check if all chars are •
|
||||||
if (e.target.value.split("").every((char) => char === "•")) {
|
if (
|
||||||
setErrorData({
|
e.target.value.split("").every((char) => char === "•")
|
||||||
title: `Invalid characters: ${e.target.value}`,
|
) {
|
||||||
list: [
|
setErrorData({
|
||||||
"It seems you are trying to paste a password. Make sure the value is visible before copying from another field.",
|
title: `Invalid characters: ${e.target.value}`,
|
||||||
],
|
list: [
|
||||||
});
|
"It seems you are trying to paste a password. Make sure the value is visible before copying from another field.",
|
||||||
}
|
],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
onChange && onChange(e.target.value);
|
onChange && onChange(e.target.value);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
onKeyDown={(e) => {
|
onKeyDown={(e) => {
|
||||||
handleKeyDown(e, value, "");
|
handleKeyDown(e, value, "");
|
||||||
if (blurOnEnter && e.key === "Enter")
|
if (blurOnEnter && e.key === "Enter")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue