|
@@ -80,7 +80,16 @@ const Input = (props: TaipyInputProps) => {
|
|
const min = useDynamicProperty(props.min, props.defaultMin, undefined);
|
|
const min = useDynamicProperty(props.min, props.defaultMin, undefined);
|
|
const max = useDynamicProperty(props.max, props.defaultMax, undefined);
|
|
const max = useDynamicProperty(props.max, props.defaultMax, undefined);
|
|
|
|
|
|
- const textSx = useMemo(() => props.width ? {...numberSx, maxWidth: getCssSize(props.width)} : numberSx, [props.width]);
|
|
|
|
|
|
+ const textSx = useMemo(
|
|
|
|
+ () =>
|
|
|
|
+ props.width
|
|
|
|
+ ? {
|
|
|
|
+ ...numberSx,
|
|
|
|
+ maxWidth: getCssSize(props.width),
|
|
|
|
+ }
|
|
|
|
+ : numberSx,
|
|
|
|
+ [props.width]
|
|
|
|
+ );
|
|
|
|
|
|
const updateValueWithDelay = useCallback(
|
|
const updateValueWithDelay = useCallback(
|
|
(value: number | string) => {
|
|
(value: number | string) => {
|
|
@@ -88,7 +97,9 @@ const Input = (props: TaipyInputProps) => {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
if (changeDelay === 0) {
|
|
if (changeDelay === 0) {
|
|
- dispatch(createSendUpdateAction(updateVarName, value, module, onChange, propagate));
|
|
|
|
|
|
+ delayCall.current = window.setTimeout(() => {
|
|
|
|
+ dispatch(createSendUpdateAction(updateVarName, value, module, onChange, propagate));
|
|
|
|
+ }, 0.1);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
if (delayCall.current > 0) {
|
|
if (delayCall.current > 0) {
|
|
@@ -107,7 +118,9 @@ const Input = (props: TaipyInputProps) => {
|
|
const val = e.target.value;
|
|
const val = e.target.value;
|
|
setValue(val);
|
|
setValue(val);
|
|
if (changeDelay === 0) {
|
|
if (changeDelay === 0) {
|
|
- dispatch(createSendUpdateAction(updateVarName, val, module, onChange, propagate));
|
|
|
|
|
|
+ delayCall.current = window.setTimeout(() => {
|
|
|
|
+ dispatch(createSendUpdateAction(updateVarName, val, module, onChange, propagate));
|
|
|
|
+ }, 0.1);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
if (changeDelay > 0) {
|
|
if (changeDelay > 0) {
|