Skip to content

Commit 20173a2

Browse files
nikitahlveidenbaums
authored andcommitted
VC-2894 Add debounce to element component update (#2091)
* VC-2894 Add debounce to element component update * VC-2894 Fix JS codestyle
1 parent 4b5eb30 commit 20173a2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

public/editor/modules/layout/lib/element.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React from 'react'
33
import ReactDOM from 'react-dom'
44
import ContentControls from 'public/components/layoutHelpers/contentControls/component'
55
import ColumnResizer from 'public/components/columnResizer/columnResizer'
6-
import { isEqual, defer, cloneDeep } from 'lodash'
6+
import { isEqual, defer, cloneDeep, debounce } from 'lodash'
77
import PropTypes from 'prop-types'
88
import EmptyCommentElementWrapper from './emptyCommentElementWrapper.tsx'
99
import ElementInner from './elementInner'
@@ -28,7 +28,7 @@ export default class Element extends React.Component {
2828

2929
constructor (props) {
3030
super(props)
31-
this.dataUpdate = this.dataUpdate.bind(this)
31+
this.dataUpdate = debounce(this.dataUpdate.bind(this), 20)
3232
this.elementComponentTransformation = this.elementComponentTransformation.bind(this)
3333
this.getEditorProps = this.getEditorProps.bind(this)
3434
this.elementComponentRef = React.createRef()

0 commit comments

Comments
 (0)