mirror of
https://github.com/mattermost/focalboard.git
synced 2025-01-11 18:13:52 +02:00
Disable patches on unmount on readOnly mode (#4089)
This commit is contained in:
parent
8d17dd820e
commit
218e24b005
@ -18,10 +18,14 @@ const BaseTextEditor = (props: PropertyProps & {validator: () => boolean, spellC
|
||||
if (value !== (props.card.fields.properties[props.propertyTemplate?.id || ''] || '')) {
|
||||
mutator.changePropertyValue(props.board.id, props.card, props.propertyTemplate?.id || '', value)
|
||||
}
|
||||
}, [props.card, props.propertyTemplate, value])
|
||||
}, [props.board.id, props.card, props.propertyTemplate?.id, value])
|
||||
|
||||
const saveTextPropertyRef = useRef<() => void>(saveTextProperty)
|
||||
saveTextPropertyRef.current = saveTextProperty
|
||||
if (props.readOnly) {
|
||||
saveTextPropertyRef.current = () => null
|
||||
} else {
|
||||
saveTextPropertyRef.current = saveTextProperty
|
||||
}
|
||||
|
||||
const intl = useIntl()
|
||||
const emptyDisplayValue = props.showEmptyPlaceholder ? intl.formatMessage({id: 'PropertyValueElement.empty', defaultMessage: 'Empty'}) : ''
|
||||
|
Loading…
Reference in New Issue
Block a user