@@ -36,8 +36,8 @@ export function LimitsPropertiesSideStack({ formName, disabled }: Readonly<Limit
3636 }
3737 if ( ! limitsProperties ?. length ) {
3838 setValue ( formName , [ { name : propertyName , value : propertyValue } ] ) ;
39- } else if ( limitsProperties . find ( ( l ) => l . name === propertyName ) ) {
40- setEditorError ( intl . formatMessage ( { id : 'UsedPropertyName ' } ) ) ;
39+ } else if ( limitsProperties . some ( ( l ) => l . name === propertyName ) ) {
40+ setEditorError ( intl . formatMessage ( { id : 'NameUnique ' } ) ) ;
4141 return ;
4242 } else {
4343 setValue ( formName , [ ...limitsProperties , { name : propertyName , value : propertyValue } ] ) ;
@@ -74,7 +74,7 @@ export function LimitsPropertiesSideStack({ formName, disabled }: Readonly<Limit
7474 disabled = { disabled }
7575 />
7676 ) ) }
77- { ! isEditing ? (
77+ { ! isEditing && (
7878 < IconButton
7979 color = "primary"
8080 sx = { { verticalAlign : 'center' } }
@@ -83,8 +83,6 @@ export function LimitsPropertiesSideStack({ formName, disabled }: Readonly<Limit
8383 >
8484 < AddCircle />
8585 </ IconButton >
86- ) : (
87- ''
8886 ) }
8987 </ Stack >
9088 { isEditing && ! disabled ? (
@@ -117,12 +115,18 @@ export function LimitsPropertiesSideStack({ formName, disabled }: Readonly<Limit
117115 < TextField
118116 size = "small"
119117 label = { intl . formatMessage ( { id : 'PropertyValue' } ) }
120- sx = { { flex : 1 } }
118+ sx = { { flex : 1 , verticalAlign : 'center' } }
121119 onKeyDown = { handleKeyPress }
122120 onChange = { ( event ) => setPropertyValue ( event . target . value ) }
123121 />
124122 { hovered && (
125- < IconButton sx = { { verticalAlign : 'center' } } onClick = { ( ) => setIsEditing ( false ) } >
123+ < IconButton
124+ sx = { { verticalAlign : 'center' } }
125+ onClick = { ( ) => {
126+ setIsEditing ( false ) ;
127+ setEditorError ( '' ) ;
128+ } }
129+ >
126130 < Delete />
127131 </ IconButton >
128132 ) }
0 commit comments