1
0
mirror of https://github.com/mattermost/focalboard.git synced 2025-09-16 08:56:19 +02:00

fix: disable rerender when markdown-editor-input is mounted

This commit is contained in:
kyeongsoosoo
2022-04-13 13:46:08 +09:00
parent 539aee6a46
commit e3a812e6c1
2 changed files with 10 additions and 1 deletions

View File

@@ -72,7 +72,12 @@ describe('Create and delete board / card', () => {
cy.log('**Create card**')
cy.get('.ViewHeader').contains('New').click()
cy.get('.CardDetail').should('exist')
//Check title has focus when card is created
cy.log('**Check title has focus when card is created**')
cy.get('.CardDetail .EditableArea.title').
should('have.focus')
// Change card title
cy.log('**Change card title**')
// eslint-disable-next-line cypress/no-unnecessary-waiting

View File

@@ -126,6 +126,10 @@ const MarkdownEditorInput = (props: Props): ReactElement => {
const onEditorStateChange = useCallback((newEditorState: EditorState) => {
const newText = newEditorState.getCurrentContent().getPlainText()
const text = editorState.getCurrentContent().getPlainText()
if(text === newText) return
onChange && onChange(newText)
setEditorState(newEditorState)
}, [onChange])