@react-aria/textfield
Advanced tools
Comparing version
@@ -57,3 +57,5 @@ var $4Z7CR$reactariautils = require("@react-aria/utils"); | ||
}; | ||
(0, $4Z7CR$reactariautils.useFormReset)(ref, value, setValue); | ||
let [initialValue] = (0, $4Z7CR$react.useState)(value); | ||
var _props_defaultValue; | ||
(0, $4Z7CR$reactariautils.useFormReset)(ref, (_props_defaultValue = props.defaultValue) !== null && _props_defaultValue !== void 0 ? _props_defaultValue : initialValue, setValue); | ||
(0, $4Z7CR$reactariaform.useFormValidation)(props, validationState, ref); | ||
@@ -99,2 +101,3 @@ (0, $4Z7CR$react.useEffect)(()=>{ | ||
name: props.name, | ||
form: props.form, | ||
placeholder: props.placeholder, | ||
@@ -101,0 +104,0 @@ inputMode: props.inputMode, |
import {filterDOMProps as $ig234$filterDOMProps, useFormReset as $ig234$useFormReset, getOwnerWindow as $ig234$getOwnerWindow, mergeProps as $ig234$mergeProps} from "@react-aria/utils"; | ||
import $ig234$react, {useEffect as $ig234$useEffect} from "react"; | ||
import $ig234$react, {useState as $ig234$useState, useEffect as $ig234$useEffect} from "react"; | ||
import {useControlledState as $ig234$useControlledState} from "@react-stately/utils"; | ||
@@ -47,3 +47,5 @@ import {useField as $ig234$useField} from "@react-aria/label"; | ||
}; | ||
(0, $ig234$useFormReset)(ref, value, setValue); | ||
let [initialValue] = (0, $ig234$useState)(value); | ||
var _props_defaultValue; | ||
(0, $ig234$useFormReset)(ref, (_props_defaultValue = props.defaultValue) !== null && _props_defaultValue !== void 0 ? _props_defaultValue : initialValue, setValue); | ||
(0, $ig234$useFormValidation)(props, validationState, ref); | ||
@@ -89,2 +91,3 @@ (0, $ig234$useEffect)(()=>{ | ||
name: props.name, | ||
form: props.form, | ||
placeholder: props.placeholder, | ||
@@ -91,0 +94,0 @@ inputMode: props.inputMode, |
{ | ||
"name": "@react-aria/textfield", | ||
"version": "3.0.0-nightly-a7b1a28e0-250707", | ||
"version": "3.0.0-nightly-a8dbaf690-250812", | ||
"description": "Spectrum UI components in React", | ||
@@ -29,10 +29,10 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@react-aria/form": "3.0.0-nightly-a7b1a28e0-250707", | ||
"@react-aria/interactions": "3.0.0-nightly-a7b1a28e0-250707", | ||
"@react-aria/label": "3.0.0-nightly-a7b1a28e0-250707", | ||
"@react-aria/utils": "3.0.0-nightly-a7b1a28e0-250707", | ||
"@react-stately/form": "3.0.0-nightly-a7b1a28e0-250707", | ||
"@react-stately/utils": "3.0.0-nightly-a7b1a28e0-250707", | ||
"@react-types/shared": "3.0.0-nightly-a7b1a28e0-250707", | ||
"@react-types/textfield": "3.0.0-nightly-a7b1a28e0-250707", | ||
"@react-aria/form": "3.0.0-nightly-a8dbaf690-250812", | ||
"@react-aria/interactions": "3.0.0-nightly-a8dbaf690-250812", | ||
"@react-aria/label": "3.0.0-nightly-a8dbaf690-250812", | ||
"@react-aria/utils": "3.0.0-nightly-a8dbaf690-250812", | ||
"@react-stately/form": "3.0.0-nightly-a8dbaf690-250812", | ||
"@react-stately/utils": "3.0.0-nightly-a8dbaf690-250812", | ||
"@react-types/shared": "3.0.0-nightly-a8dbaf690-250812", | ||
"@react-types/textfield": "3.0.0-nightly-a8dbaf690-250812", | ||
"@swc/helpers": "^0.5.0" | ||
@@ -39,0 +39,0 @@ }, |
@@ -22,3 +22,4 @@ /* | ||
RefObject, | ||
useEffect | ||
useEffect, | ||
useState | ||
} from 'react'; | ||
@@ -146,3 +147,4 @@ import {useControlledState} from '@react-stately/utils'; | ||
useFormReset(ref, value, setValue); | ||
let [initialValue] = useState(value); | ||
useFormReset(ref, props.defaultValue ?? initialValue, setValue); | ||
useFormValidation(props, validationState, ref); | ||
@@ -191,2 +193,3 @@ | ||
name: props.name, | ||
form: props.form, | ||
placeholder: props.placeholder, | ||
@@ -193,0 +196,0 @@ inputMode: props.inputMode, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
118916
1.11%1230
0.99%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated
Updated