Disable onClick for resize area of Interactive components

Summary: This was causing resizing to trigger onClick every time, which isn't wanted.

Reviewed By: passy

Differential Revision: D15219039

fbshipit-source-id: ea5d9221b0ce8fa7a050a8410876cf78bfee2bc6
This commit is contained in:
John Knox
2019-05-07 11:23:50 -07:00
committed by Facebook Github Bot
parent cdd733463a
commit 9bd6b6a607

View File

@@ -323,6 +323,12 @@ export default class Interactive extends React.Component<
}
};
onClick = (e: SyntheticMouseEvent<>) => {
if (this.state.couldResize) {
e.stopPropagation();
}
};
calculateMove(event: SyntheticMouseEvent<>) {
const {movingInitialCursor, movingInitialProps} = this.state;
@@ -687,6 +693,7 @@ export default class Interactive extends React.Component<
onMouseDown={this.startAction}
onMouseMove={this.onLocalMouseMove}
onMouseLeave={this.onMouseLeave} // eslint-disable-next-line
onClick={this.onClick}
style={style}>
{this.props.children}
</InteractiveContainer>