@etsoo/materialui 1.0.98 → 1.0.99
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.
- package/lib/DataSteps.js +5 -4
- package/package.json +1 -1
- package/src/DataSteps.tsx +7 -3
package/lib/DataSteps.js
CHANGED
|
@@ -5,9 +5,9 @@ import NavigateBeforeIcon from '@mui/icons-material/NavigateBefore';
|
|
|
5
5
|
import CheckIcon from '@mui/icons-material/Check';
|
|
6
6
|
import StartIcon from '@mui/icons-material/Start';
|
|
7
7
|
import React from 'react';
|
|
8
|
+
import { HBox } from './FlexBox';
|
|
8
9
|
import { globalApp } from './app/ReactApp';
|
|
9
10
|
import { MUGlobal } from './MUGlobal';
|
|
10
|
-
import { HBox } from './FlexBox';
|
|
11
11
|
/**
|
|
12
12
|
* Data collecting steps component
|
|
13
13
|
* @param props Props
|
|
@@ -27,7 +27,8 @@ export function DataSteps(props) {
|
|
|
27
27
|
const indexRef = React.useRef(-1);
|
|
28
28
|
// Current Json data
|
|
29
29
|
const jsonRef = React.useRef(jsonValue);
|
|
30
|
-
|
|
30
|
+
// Ignore empty value case
|
|
31
|
+
if (jsonValue !== jsonRef.current && valueFormatter(jsonValue))
|
|
31
32
|
jsonRef.current = jsonValue;
|
|
32
33
|
// Current value
|
|
33
34
|
const [localValue, setLocalValue] = React.useState(value);
|
|
@@ -72,8 +73,8 @@ export function DataSteps(props) {
|
|
|
72
73
|
};
|
|
73
74
|
React.useEffect(() => {
|
|
74
75
|
setLocalValue(valueFormatter(jsonRef.current));
|
|
75
|
-
}, [
|
|
76
|
-
return (React.createElement(TextField, { InputLabelProps: InputLabelProps, inputProps: { style: { cursor: 'pointer' } }, InputProps: {
|
|
76
|
+
}, [valueFormatter]);
|
|
77
|
+
return (React.createElement(TextField, { autoComplete: "new-password", InputLabelProps: InputLabelProps, inputProps: { style: { cursor: 'pointer' } }, InputProps: {
|
|
77
78
|
onKeyDown: (event) => {
|
|
78
79
|
if (event.key === 'Tab')
|
|
79
80
|
return;
|
package/package.json
CHANGED
package/src/DataSteps.tsx
CHANGED
|
@@ -12,9 +12,9 @@ import CheckIcon from '@mui/icons-material/Check';
|
|
|
12
12
|
import StartIcon from '@mui/icons-material/Start';
|
|
13
13
|
import { InputDialogProps } from '@etsoo/react';
|
|
14
14
|
import React from 'react';
|
|
15
|
+
import { HBox } from './FlexBox';
|
|
15
16
|
import { globalApp } from './app/ReactApp';
|
|
16
17
|
import { MUGlobal } from './MUGlobal';
|
|
17
|
-
import { HBox } from './FlexBox';
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Data step
|
|
@@ -85,7 +85,10 @@ export function DataSteps<T extends object>(props: DataStepsProps<T>) {
|
|
|
85
85
|
|
|
86
86
|
// Current Json data
|
|
87
87
|
const jsonRef = React.useRef<T>(jsonValue);
|
|
88
|
-
|
|
88
|
+
|
|
89
|
+
// Ignore empty value case
|
|
90
|
+
if (jsonValue !== jsonRef.current && valueFormatter(jsonValue))
|
|
91
|
+
jsonRef.current = jsonValue;
|
|
89
92
|
|
|
90
93
|
// Current value
|
|
91
94
|
const [localValue, setLocalValue] = React.useState(value);
|
|
@@ -174,10 +177,11 @@ export function DataSteps<T extends object>(props: DataStepsProps<T>) {
|
|
|
174
177
|
|
|
175
178
|
React.useEffect(() => {
|
|
176
179
|
setLocalValue(valueFormatter(jsonRef.current));
|
|
177
|
-
}, [
|
|
180
|
+
}, [valueFormatter]);
|
|
178
181
|
|
|
179
182
|
return (
|
|
180
183
|
<TextField
|
|
184
|
+
autoComplete="new-password"
|
|
181
185
|
InputLabelProps={InputLabelProps}
|
|
182
186
|
inputProps={{ style: { cursor: 'pointer' } }}
|
|
183
187
|
InputProps={{
|