@mezzanine-ui/react-hook-form
Advanced tools
Comparing version 0.16.4 to 0.16.5
{ | ||
"name": "@mezzanine-ui/react-hook-form", | ||
"version": "0.16.4", | ||
"version": "0.16.5", | ||
"description": "Form with data binding HOC for mezzanine-ui", | ||
@@ -5,0 +5,0 @@ "author": "mezzanine", |
@@ -9,3 +9,3 @@ import { jsx, jsxs } from 'react/jsx-runtime'; | ||
function SelectField(props) { | ||
const { className, clearable = false, defaultValue, disabled, fullWidth, width, inputMode, itemScope = false, label, mode, itemsInView, optionGroups, options, placeholder = '請選擇', popperOptions, registerName, remark, renderValue, required, role, size, style, errorMsgRender, onChange: onChangeProp, disabledErrMsg, ...restProps } = props || {}; | ||
const { className, clearable = false, defaultValue, disabled, fullWidth, width, inputMode, itemScope = false, label, mode, itemsInView, optionGroups, options, placeholder = '請選擇', popperOptions, registerName, remark, renderValue, required, role, size, style, errorMsgRender, onChange: onChangeProp, onClear: onClearProp, disabledErrMsg, ...restProps } = props || {}; | ||
const { clearErrors, formState: { errors }, control, resetField, setValue, } = useFormContext(); | ||
@@ -17,5 +17,6 @@ const watchValue = useWatch({ | ||
}) || defaultValue; | ||
const onClear = () => { | ||
const onClear = (e) => { | ||
resetField(registerName); | ||
setValue(registerName, undefined, { shouldValidate: true }); | ||
onClearProp === null || onClearProp === void 0 ? void 0 : onClearProp(e); | ||
}; | ||
@@ -22,0 +23,0 @@ const onChange = (newValue) => { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
130985
2353