fixed marker dragging

This commit is contained in:
Fedor Katurov 2021-04-08 14:44:13 +07:00
parent 3109f49cc4
commit 4e167c9759
8 changed files with 53 additions and 67 deletions

View file

@ -21,12 +21,12 @@ class StickerDesc extends React.PureComponent<Props, State> {
};
blockMouse = e => {
e.preventDefault();
e.stopPropagation();
this.input.focus();
};
input: HTMLTextAreaElement;
// todo: pass here locker for moving markers from Sticker.js
render() {
const { value: text } = this.props;
@ -34,10 +34,10 @@ class StickerDesc extends React.PureComponent<Props, State> {
return (
<div
className={classnames('sticker-desc', { is_empty: !text.trim() })}
onMouseDown={this.blockMouse}
onMouseUp={this.blockMouse}
onDragStart={this.blockMouse}
onTouchStart={this.blockMouse}
onMouseDownCapture={this.blockMouse}
onMouseUpCapture={this.blockMouse}
onDragStartCapture={this.blockMouse}
onTouchStartCapture={this.blockMouse}
>
<div className="sticker-desc-sizer">
<span
@ -59,4 +59,4 @@ class StickerDesc extends React.PureComponent<Props, State> {
}
}
export { StickerDesc };
export { StickerDesc };