question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question: Why is there no OnDragOriginStart.set, OnRoundStart.set

See original GitHub issue

Environments

  • Framework name: VanillaJS
  • Moveable Component version: 0.41.1

Description

Moveable currently initializes the drag origin of a given target at the current value they have set for transformOrigin, defaulting to 50%, 50%. The same goes for border radius and roundable.

Would adding in e.set to these two be useful?

  dragOriginStart (e) {
    const state = getState(e.target)
    e.set(state.origin) // <--
    e.dragStart && e.dragStart.set(state.translate)
  },

Issue Analytics

  • State:open
  • Created 9 months ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
daybrushcommented, Dec 7, 2022

@SidIcarus

This is a demo created in the first step of creating Moveable.

So, the usage has changed a bit.

The demo is also in the process of being changed.

https://daybrush.com/moveable/storybook2

0reactions
daybrushcommented, Dec 7, 2022

@SidIcarus

Although it seems to be rarely used, set is called internally with the default value.

Perhaps in the next version there will be a simpler usage.

  1. Current
onDrag={e => {
    e.target.style.transform = e.transform;
}}
onDragOrigin={e => {
    e.target.style.transformOrigin = e.transformOrigin;
    e.target.style.transform = e.drag.transform;
}}
  1. Next 1
onDrag={e => {
    e.target.style.cssText += e.cssText;
}}
onDragOrigin={e => {
    e.target.style.cssText += e.cssText;
}}
  1. Next 2
onRender={e => {
    e.target.style.cssText += e.cssText;
}}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · daybrush/moveable - GitHub
Trigger Resize Event on the corner Scaling Buttons renderDirections: ['nw', ... Question: Why is there no OnDragOriginStart.set, OnRoundStart.set question ...
Read more >
Home - Documentation - Daybrush
Features. Draggable refers to the ability to drag and move targets. Resizable indicates whether the target's width and height can be increased or...
Read more >
Daybrush Moveable Issues - IssueHint
Question: Why is there no OnDragOriginStart.set, OnRoundStart.set, open, 5, 2022-12-07, 2022-12-11. Shake during resize with transform scale and guidelines ...
Read more >
Daybrush (Younkue Choi) moveable Issues - Giters
Trigger Resize Event on the corner Scaling Buttons renderDirections: ['nw', 'ne', ... Question: Why is there no OnDragOriginStart.set, OnRoundStart.set.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found