Fix InputGroup not refreshing when selecting a different element

This commit is contained in:
Eric NGUYEN 2022-09-13 18:12:20 +02:00
parent 021af3e70f
commit 7494383f58
2 changed files with 14 additions and 1 deletions

View file

@ -1,6 +1,8 @@
import * as React from 'react';
interface ITextInputGroupProps {
/** Use key the same way as React.Key */
key: string
labelKey?: string
labelText: string
inputKey: string
@ -22,7 +24,7 @@ export function TextInputGroup(props: ITextInputGroupProps): JSX.Element {
React.useEffect(() => {
setValue(props.value);
}, [props.value]);
}, [props.value, props.key]);
function OnKeyUp(event: React.KeyboardEvent): void {
switch (event.key) {