From af6462dfd3c75b1c09f58c739f82afee5c86520d Mon Sep 17 00:00:00 2001 From: vikram Date: Tue, 15 Oct 2024 17:15:16 +0530 Subject: [PATCH] fix: Number kind grid cell edit behavior update for ux improvement --- .../private/number-overlay-editor.tsx | 2 +- test-projects/cra5-gdg/public/index.html | 1 + test-projects/cra5-gdg/src/App.tsx | 10 +- .../cra5-gdg/src/components/Grid.tsx | 121 ++++++++++++++---- 4 files changed, 96 insertions(+), 38 deletions(-) diff --git a/packages/core/src/internal/data-grid-overlay-editor/private/number-overlay-editor.tsx b/packages/core/src/internal/data-grid-overlay-editor/private/number-overlay-editor.tsx index 4a539916f..93df85a27 100644 --- a/packages/core/src/internal/data-grid-overlay-editor/private/number-overlay-editor.tsx +++ b/packages/core/src/internal/data-grid-overlay-editor/private/number-overlay-editor.tsx @@ -65,7 +65,7 @@ const NumberOverlayEditor: React.FunctionComponent = p => { allowNegative={allowNegative} thousandSeparator={thousandSeparator ?? getThousandSeprator()} decimalSeparator={decimalSeparator ?? getDecimalSeparator()} - value={Object.is(value, -0) ? "-" : value ?? ""} + defaultValue={Object.is(value, -0) ? "-" : value ?? ""} // decimalScale={3} // prefix={"$"} onValueChange={onChange} diff --git a/test-projects/cra5-gdg/public/index.html b/test-projects/cra5-gdg/public/index.html index aa069f27c..3f610e21d 100644 --- a/test-projects/cra5-gdg/public/index.html +++ b/test-projects/cra5-gdg/public/index.html @@ -29,6 +29,7 @@
+