Skip to content

Commit e8cd4a2

Browse files
authored
ColorPalette - fix orientation change called unnecessarily (#725)
1 parent 6341c5e commit e8cd4a2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/components/colorPicker/ColorPalette.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,10 @@ export default class ColorPalette extends PureBaseComponent {
9898
}
9999

100100
onOrientationChanged = () => {
101-
this.initLocalVariables();
102-
this.setState({orientation: Constants.orientation}); // only to trigger render
101+
if (this.state.orientation !== Constants.orientation) {
102+
this.initLocalVariables();
103+
this.setState({orientation: Constants.orientation}); // only to trigger render
104+
}
103105
}
104106

105107
initLocalVariables() {

0 commit comments

Comments
 (0)