From 4e6dfb4e1eee77165c064a9a4f9a726c11b9641c Mon Sep 17 00:00:00 2001 From: aritrakoley Date: Sat, 15 Jan 2022 19:32:23 +0530 Subject: [PATCH] Fix Issue #15924 (Number control does not update when using useArgs hook) --- lib/components/src/controls/Number.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/components/src/controls/Number.tsx b/lib/components/src/controls/Number.tsx index bee111677646..24c8db6567c3 100644 --- a/lib/components/src/controls/Number.tsx +++ b/lib/components/src/controls/Number.tsx @@ -58,6 +58,13 @@ export const NumberControl: FC = ({ if (forceVisible && htmlElRef.current) htmlElRef.current.select(); }, [forceVisible]); + useEffect(() => { + const newInputValue = typeof value === 'number' ? value : ''; + if (inputValue !== newInputValue) { + setInputValue(value); + } + }, [value]); + if (!forceVisible && value === undefined) { return (