Set input group in orange when modified but not applied

This commit is contained in:
Eric NGUYEN 2022-09-13 17:52:36 +02:00
parent a9831b6b7f
commit e3f57773d7

View file

@ -1,5 +1,4 @@
import * as React from 'react';
import { Properties } from '../ContainerProperties/ContainerProperties';
interface ITextInputGroupProps {
labelKey?: string
@ -36,6 +35,8 @@ export function TextInputGroup(props: ITextInputGroupProps): JSX.Element {
}
}
const warningClass = props.value !== value ? 'focus:border-orange-200 border-orange-200 focus:ring-orange-200 ring-orange-200' : '';
return <>
<label
key={props.labelKey}
@ -47,7 +48,7 @@ export function TextInputGroup(props: ITextInputGroupProps): JSX.Element {
<input
key={props.inputKey}
id={props.inputKey}
className={`${className} ${props.inputClassName}`}
className={`${className} ${props.inputClassName} ${warningClass}`}
type={props.type}
value={value}
onChange={(event) => setValue(event.target.value)}