mirror of
https://github.com/mattermost/focalboard.git
synced 2025-01-26 18:48:15 +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 || ''] || '')) {
|
if (value !== (props.card.fields.properties[props.propertyTemplate?.id || ''] || '')) {
|
||||||
mutator.changePropertyValue(props.board.id, props.card, props.propertyTemplate?.id || '', value)
|
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)
|
const saveTextPropertyRef = useRef<() => void>(saveTextProperty)
|
||||||
saveTextPropertyRef.current = saveTextProperty
|
if (props.readOnly) {
|
||||||
|
saveTextPropertyRef.current = () => null
|
||||||
|
} else {
|
||||||
|
saveTextPropertyRef.current = saveTextProperty
|
||||||
|
}
|
||||||
|
|
||||||
const intl = useIntl()
|
const intl = useIntl()
|
||||||
const emptyDisplayValue = props.showEmptyPlaceholder ? intl.formatMessage({id: 'PropertyValueElement.empty', defaultMessage: 'Empty'}) : ''
|
const emptyDisplayValue = props.showEmptyPlaceholder ? intl.formatMessage({id: 'PropertyValueElement.empty', defaultMessage: 'Empty'}) : ''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user