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:
committed by
Facebook Github Bot
parent
cdd733463a
commit
9bd6b6a607
@@ -323,6 +323,12 @@ export default class Interactive extends React.Component<
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
onClick = (e: SyntheticMouseEvent<>) => {
|
||||||
|
if (this.state.couldResize) {
|
||||||
|
e.stopPropagation();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
calculateMove(event: SyntheticMouseEvent<>) {
|
calculateMove(event: SyntheticMouseEvent<>) {
|
||||||
const {movingInitialCursor, movingInitialProps} = this.state;
|
const {movingInitialCursor, movingInitialProps} = this.state;
|
||||||
|
|
||||||
@@ -687,6 +693,7 @@ export default class Interactive extends React.Component<
|
|||||||
onMouseDown={this.startAction}
|
onMouseDown={this.startAction}
|
||||||
onMouseMove={this.onLocalMouseMove}
|
onMouseMove={this.onLocalMouseMove}
|
||||||
onMouseLeave={this.onMouseLeave} // eslint-disable-next-line
|
onMouseLeave={this.onMouseLeave} // eslint-disable-next-line
|
||||||
|
onClick={this.onClick}
|
||||||
style={style}>
|
style={style}>
|
||||||
{this.props.children}
|
{this.props.children}
|
||||||
</InteractiveContainer>
|
</InteractiveContainer>
|
||||||
|
|||||||
Reference in New Issue
Block a user