Skip to content

Commit

Permalink
VC-2894 Add debounce to element component update (#2091)
Browse files Browse the repository at this point in the history
* VC-2894 Add debounce to element component update

* VC-2894 Fix JS codestyle
  • Loading branch information
nikitahl authored and veidenbaums committed Jun 30, 2022
1 parent 4b5eb30 commit 20173a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions public/editor/modules/layout/lib/element.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react'
import ReactDOM from 'react-dom'
import ContentControls from 'public/components/layoutHelpers/contentControls/component'
import ColumnResizer from 'public/components/columnResizer/columnResizer'
import { isEqual, defer, cloneDeep } from 'lodash'
import { isEqual, defer, cloneDeep, debounce } from 'lodash'
import PropTypes from 'prop-types'
import EmptyCommentElementWrapper from './emptyCommentElementWrapper.tsx'
import ElementInner from './elementInner'
Expand All @@ -28,7 +28,7 @@ export default class Element extends React.Component {

constructor (props) {
super(props)
this.dataUpdate = this.dataUpdate.bind(this)
this.dataUpdate = debounce(this.dataUpdate.bind(this), 20)
this.elementComponentTransformation = this.elementComponentTransformation.bind(this)
this.getEditorProps = this.getEditorProps.bind(this)
this.elementComponentRef = React.createRef()
Expand Down

0 comments on commit 20173a2

Please sign in to comment.