This commit is contained in:
Fedor Katurov 2020-01-10 09:21:37 +07:00
parent cb07aa9fb0
commit 8adf64acb9
6 changed files with 94 additions and 355 deletions

View file

@ -11,6 +11,7 @@ import { MapContainer } from '~/constants/map';
interface IProps {
map: MapContainer;
sticker: IStickerDump;
onDragStart?: () => void;
index: number;
is_editing: boolean;
@ -53,7 +54,12 @@ const Sticker: React.FC<IProps> = ({
setDragging(true);
}, [setDragging, layer, map]);
const onDragStop = React.useCallback(() => {
const onDragStop = React.useCallback(event => {
event.stopPropagation();
event.preventDefault();
if (!layer) return;
setDragging(false);
onChange({
...sticker,