@portnet/ui 0.0.100 → 0.0.102

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -145,6 +145,9 @@ const PuiStandardAutocomplete = /*#__PURE__*/React.forwardRef((_ref, ref) => {
145
145
  label: label,
146
146
  error: error,
147
147
  helperText: helperText,
148
+ inputProps: {
149
+ name
150
+ },
148
151
  InputProps: _objectSpread(_objectSpread({}, params.InputProps), {}, {
149
152
  endAdornment: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
150
153
  children: [loading && !disabled ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.CircularProgress, {
@@ -108,7 +108,10 @@ const PuiStandardDateField = /*#__PURE__*/React.forwardRef((_ref, ref) => {
108
108
  onBlur: onBlur,
109
109
  helperText: helperText
110
110
  }, params), {}, {
111
- error: params.error || error
111
+ error: params.error || error,
112
+ inputProps: {
113
+ name
114
+ }
112
115
  }))
113
116
  }, rest));
114
117
  });
@@ -103,7 +103,10 @@ const PuiStandardDateTimeField = /*#__PURE__*/React.forwardRef((_ref, ref) => {
103
103
  onBlur: onBlur,
104
104
  helperText: helperText
105
105
  }, params), {}, {
106
- error: params.error || error
106
+ error: params.error || error,
107
+ inputProps: {
108
+ name
109
+ }
107
110
  }))
108
111
  }, rest));
109
112
  });
@@ -94,6 +94,9 @@ const PuiStandardFileField = /*#__PURE__*/React.forwardRef((_ref, ref) => {
94
94
  focused: focused,
95
95
  fullWidth: fullWidth,
96
96
  helperText: helperText,
97
+ inputProps: {
98
+ name
99
+ },
97
100
  InputProps: _objectSpread({
98
101
  endAdornment: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiButton.default, {
99
102
  children: buttonText
@@ -81,6 +81,9 @@ const PuiStandardTextField = /*#__PURE__*/React.forwardRef((_ref, ref) => {
81
81
  onChange: onChange,
82
82
  onClick: onClick,
83
83
  onBlur: onBlur,
84
+ inputProps: {
85
+ name
86
+ },
84
87
  InputProps: _objectSpread({
85
88
  readOnly
86
89
  }, InputProps)
@@ -18,7 +18,8 @@ const PuiFormikForm = _ref => {
18
18
  const {
19
19
  isSubmitting,
20
20
  isValid,
21
- isValidating
21
+ isValidating,
22
+ errors
22
23
  } = (0, _formik.useFormikContext)();
23
24
  React.useEffect(() => {
24
25
  if (isSubmitting || isValidating) {
@@ -26,14 +27,18 @@ const PuiFormikForm = _ref => {
26
27
  }
27
28
  }, [isSubmitting, isValidating]);
28
29
  React.useEffect(() => {
29
- if (verifyError && !isValid && !isValidating) {
30
- const element = document.querySelector(".Mui-error");
31
- element.scrollIntoView({
32
- behavior: "smooth",
33
- block: "center"
34
- });
30
+ const errorsKeys = Object.keys(errors);
31
+ if (verifyError && !isValid && !isValidating && errorsKeys.length !== 0) {
32
+ const element = document.querySelector("[name='".concat(errorsKeys[0], "']"));
33
+ if (Boolean(element)) {
34
+ element.scrollIntoView({
35
+ behavior: "smooth",
36
+ block: "center"
37
+ });
38
+ }
39
+ setVerifyError(false);
35
40
  }
36
- }, [verifyError, isValid, isValidating]);
41
+ }, [verifyError, isValid, isValidating, errors]);
37
42
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_formik.Form, {
38
43
  children: children
39
44
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@portnet/ui",
3
- "version": "0.0.100",
3
+ "version": "0.0.102",
4
4
  "description": "Portnet UI",
5
5
  "keywords": [
6
6
  "react",