mirror of
https://github.com/logos-storage/logos-storage-marketplace-ui-components.git
synced 2026-01-02 13:33:09 +00:00
Update manualy the input invalid property
This commit is contained in:
parent
579ab4fbed
commit
52c659b9f3
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@codex-storage/marketplace-ui-components",
|
"name": "@codex-storage/marketplace-ui-components",
|
||||||
"version": "0.0.51",
|
"version": "0.0.52",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@codex-storage/marketplace-ui-components",
|
"name": "@codex-storage/marketplace-ui-components",
|
||||||
"version": "0.0.51",
|
"version": "0.0.52",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@codex-storage/sdk-js": "https://github.com/codex-storage/codex-js#feat/support-basic-auth",
|
"@codex-storage/sdk-js": "https://github.com/codex-storage/codex-js#feat/support-basic-auth",
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/codex-storage/codex-marketplace-ui-components"
|
"url": "https://github.com/codex-storage/codex-marketplace-ui-components"
|
||||||
},
|
},
|
||||||
"version": "0.0.51",
|
"version": "0.0.52",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepack": "npm run build",
|
"prepack": "npm run build",
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import {
|
|||||||
ComponentType,
|
ComponentType,
|
||||||
forwardRef,
|
forwardRef,
|
||||||
InputHTMLAttributes,
|
InputHTMLAttributes,
|
||||||
|
useEffect,
|
||||||
useState,
|
useState,
|
||||||
} from "react";
|
} from "react";
|
||||||
import { attributes } from "../utils/attributes";
|
import { attributes } from "../utils/attributes";
|
||||||
@ -64,6 +65,12 @@ export const Input = forwardRef<HTMLInputElement, Props>(
|
|||||||
) => {
|
) => {
|
||||||
const [invalid, setInvalid] = useState(isInvalid);
|
const [invalid, setInvalid] = useState(isInvalid);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (mode === "manual") {
|
||||||
|
setInvalid(isInvalid);
|
||||||
|
}
|
||||||
|
}, [mode, isInvalid]);
|
||||||
|
|
||||||
const onInternalChange = (e: ChangeEvent<HTMLInputElement>) => {
|
const onInternalChange = (e: ChangeEvent<HTMLInputElement>) => {
|
||||||
if (mode === "auto") {
|
if (mode === "auto") {
|
||||||
setInvalid(e.currentTarget.checkValidity() !== true);
|
setInvalid(e.currentTarget.checkValidity() !== true);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user