moveable icon indicating copy to clipboard operation
moveable copied to clipboard

Increasing moveable-line hit area

Open bytasv opened this issue 2 years ago • 11 comments

Environments

  • Framework name: moveable
  • Framework version: latest
  • Moveable Component version: latest

Description

Hello,

I was wondering if there is an easy way to increase .moveable-line hit/click area without overriding CSS? 🤔 Right now it seems that it is only 1px which is quite easy to miss.

Current workaround that I'm using is:

.movable :global(.moveable-line) {
  height: 11px !important;
  background: transparent !important;
}

.movable :global(.moveable-line:after) {
  content: '';
  width: 100%;
  height: 1px;
  display: block;
  position: relative;
  top: 5px;
}

It fixes click area, but messes up other moveable-lines :(

Thank you!

bytasv avatar Jan 09 '23 19:01 bytasv

@bytasv image

I would make a linePadding prop(type: number).

If you ignore the background color, you want this function, right?

daybrush avatar Jan 29 '23 11:01 daybrush

@bytasv

moveable's new version is released. linePadding prop was added.

set linePadding to 10 (number)

daybrush avatar Jan 29 '23 14:01 daybrush

Thanks a lot, that works great!

bytasv avatar Feb 21 '23 07:02 bytasv

@daybrush Hi, first thank you so much for your incredible package, second I wanted to know is it possible to increase hit area for moveable-controls as it is in canva for mobile devices?

golnaaz73 avatar Feb 25 '23 15:02 golnaaz73

@golnaaz73

The zoom property is supported. Would you like to try it?

zoom={2}

daybrush avatar Mar 02 '23 12:03 daybrush

@golnaaz73

The zoom property is supported. Would you like to try it?

zoom={2}

I've tried that but it increases moveable-controls size. I just want to increase hit area without making controls bigger. exactly like line-padding but for controls

golnaaz73 avatar Mar 02 '23 12:03 golnaaz73

@golnaaz73

okay. As a feature I would add a controlPadding prop just like linePadding.

daybrush avatar Mar 02 '23 12:03 daybrush

@golnaaz73

okay. As a feature I would add a controlPadding prop just like linePadding.

Thank you so much

golnaaz73 avatar Mar 02 '23 12:03 golnaaz73

@golnaaz73

moveable's new version is released.

displayAroundControls, controlPadding prop were added.

set displayAroundControls(default: false) to true. and controlPadding (default: 20)

https://daybrush.com/moveable/storybook2/?path=/story/options--controlpadding

daybrush avatar Mar 08 '23 18:03 daybrush

@golnaaz73

moveable's new version is released.

displayAroundControls, controlPadding prop were added.

set displayAroundControls(default: false) to true. and controlPadding (default: 20)

https://daybrush.com/moveable/storybook2/?path=/story/options--controlpadding

Thanks a lot

golnaaz73 avatar Mar 09 '23 06:03 golnaaz73

@daybrush linePadding and controlPadding are great options! Thanks! The way linePadding currently works is it adds padding to the outside of the item. But sometimes during resizing, it behaves wierdly as cursor types keep on changing (from resize to move .. etc). This problem could be solved, if linePadding also adds padding to the internal area of the item from the edge. So when we want to start resize, we dont have to go to the edge but we can start from some area below/above the edge as well.

anshuljhawar avatar Aug 24 '23 12:08 anshuljhawar