Skip to content

Commit 245be0d

Browse files
authored
Merge pull request #80 from FezVrasta/perf/hover-optimization
perf: don’t trigger layout event if hover is not in picking modes
2 parents 319b89d + 2f90530 commit 245be0d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/core/View.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,12 @@ export default class View extends Component {
307307
this.getScreenEventPositionFor(e),
308308
e
309309
);
310-
this.onMouseMove = (e) => this.hover(this.getScreenEventPositionFor(e), e);
310+
this.onMouseMove = (e) => {
311+
// Only trigger hover if it's listed in the picking modes
312+
if (this.props.pickingModes.indexOf('hover') !== -1) {
313+
this.hover(this.getScreenEventPositionFor(e), e);
314+
}
315+
};
311316
this.lastSelection = [];
312317

313318
this.onBoxSelectChange = select;

0 commit comments

Comments
 (0)