Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update react-moveable and disable snap distance #488

Merged
merged 8 commits into from
Mar 9, 2020

Conversation

wassgha
Copy link
Contributor

@wassgha wassgha commented Mar 5, 2020

Closes #285, Closes #370

Changes

  • Upgrades react-moveable to 0.18.1
  • Disables numbers shown when snapping
  • Adds snapping to inner bounds of the crop window
  • Disables snapping when the ⌘ key is pressed (Holding CRTL/CMD does not disable snapping #370)
  • Exposes ability to bind to keyup, keypress or keydown in useKeyDownEffect

@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2020

Size Change: +5.49 kB (1%)

Total Size: 351 kB

Filename Size Change
assets/js/edit-story.js 310 kB +5.49 kB (1%)
ℹ️ View Unchanged
Filename Size Change
assets/css/edit-story.css 189 B 0 B
assets/css/stories-dashboard.css 165 B 0 B
assets/js/stories-dashboard.js 40.9 kB 0 B

compressed-size-action

@swissspidy swissspidy added the Type: Enhancement New feature or improvement of an existing feature label Mar 5, 2020
@@ -29,6 +29,7 @@ import objectWithout from '../../utils/objectWithout';
import { useTransform } from '../transform';
import { useUnits } from '../../units';
import { getDefinitionForType } from '../../elements';
import { useGlobalKeyDownEffect, useGlobalKeyUpEffect } from '../keyboard';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since single- and multiselection seem to share the snapping props, would it perhaps make sense to create the key handler in Selection and set the snapping props there instead to pass down? Or alternatively use an util for getting the snapping props. Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's a lot more we can refactor between the two, I'd leave this for another PR

@wassgha wassgha requested a review from dvoytenko March 7, 2020 02:41
@wassgha wassgha changed the title Add crop inner bounds and disable snap distance Update react-moveable and disable snap distance Mar 9, 2020
@wassgha wassgha merged commit fe8b307 into master Mar 9, 2020
@wassgha wassgha deleted the update/react-moveable branch March 9, 2020 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement New feature or improvement of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Holding CRTL/CMD does not disable snapping Snap to dimensions of elements
6 participants