1
0
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:
Jesús Espino 2022-10-26 20:57:03 +02:00 committed by GitHub
parent 8d17dd820e
commit 218e24b005
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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'}) : ''