|
@@ -21,7 +21,7 @@ import ArrowDropUpIcon from "@mui/icons-material/ArrowDropUp";
|
|
import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown";
|
|
import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown";
|
|
|
|
|
|
import { createSendActionNameAction, createSendUpdateAction } from "../../context/taipyReducers";
|
|
import { createSendActionNameAction, createSendUpdateAction } from "../../context/taipyReducers";
|
|
-import { TaipyInputProps } from "./utils";
|
|
|
|
|
|
+import { getCssSize, TaipyInputProps } from "./utils";
|
|
import { useClassNames, useDispatch, useDynamicProperty, useModule } from "../../utils/hooks";
|
|
import { useClassNames, useDispatch, useDynamicProperty, useModule } from "../../utils/hooks";
|
|
|
|
|
|
const AUTHORIZED_KEYS = ["Enter", "Escape", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12"];
|
|
const AUTHORIZED_KEYS = ["Enter", "Escape", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12"];
|
|
@@ -80,6 +80,8 @@ 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 updateValueWithDelay = useCallback(
|
|
const updateValueWithDelay = useCallback(
|
|
(value: number | string) => {
|
|
(value: number | string) => {
|
|
if (changeDelay === -1) {
|
|
if (changeDelay === -1) {
|
|
@@ -313,7 +315,7 @@ const Input = (props: TaipyInputProps) => {
|
|
return (
|
|
return (
|
|
<Tooltip title={hover || ""}>
|
|
<Tooltip title={hover || ""}>
|
|
<TextField
|
|
<TextField
|
|
- sx={numberSx}
|
|
|
|
|
|
+ sx={textSx}
|
|
margin="dense"
|
|
margin="dense"
|
|
hiddenLabel
|
|
hiddenLabel
|
|
value={value ?? ""}
|
|
value={value ?? ""}
|