Fix: don't attempt grouping while mouse is down (#34448) (#34463)

This commit is contained in:
Robert Monfera 2019-04-08 19:22:22 +02:00 committed by GitHub
parent dc714d2e5f
commit 1818c4c7b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -181,7 +181,7 @@ const rotationTooltipAnnotation = select(getRotationTooltipAnnotation)(
cursorPosition
);
const groupAction = select(getGroupAction)(actionEvent);
const groupAction = select(getGroupAction)(actionEvent, mouseIsDown);
const grouping = select(getGrouping)(
configuration,

View file

@ -1358,9 +1358,9 @@ export const getSnappedShapes = (
export const getConstrainedShapesWithPreexistingAnnotations = (snapped, transformed) =>
snapped.concat(transformed.filter(s => s.type === 'annotation'));
export const getGroupAction = action => {
export const getGroupAction = (action, mouseIsDown) => {
const event = action && action.event;
return event === 'group' || event === 'ungroup' ? event : null;
return !mouseIsDown && (event === 'group' || event === 'ungroup') ? event : null;
};
export const getGroupedSelectedShapes = ({ selectedShapes }) => selectedShapes;