Fix InputGroup not refreshing when selecting a different element
This commit is contained in:
parent
021af3e70f
commit
7494383f58
2 changed files with 14 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue