You've already forked focalboard
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:
@@ -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
|
||||
|
@@ -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])
|
||||
|
Reference in New Issue
Block a user