moveable icon indicating copy to clipboard operation
moveable copied to clipboard

How to hide the blue handles?

Open mspoulsen opened this issue 4 years ago • 13 comments

Hi,

I have a modal that I am trying to make moveable. I obviously don't want the blue handles surrounding the modal. How do I hide them? I have been searching the docs, but without success.

Thanks in advance!

mspoulsen avatar Jun 13 '21 08:06 mspoulsen

@mspoulsen

hide it via css

.moveable-line {
   display: none!important;
}

daybrush avatar Jun 15 '21 14:06 daybrush

Hmm...strange that this option is not part of the config. But thanks anyway :+1:

mspoulsen avatar Jun 16 '21 09:06 mspoulsen

Hmm...strange that this option is not part of the config. But thanks anyway 👍

Hi did this fix work for you? I tried doing the same but it didn't remove the blue handlers.

aayush801 avatar Nov 16 '21 16:11 aayush801

@mspoulsen @aayush801

  • moveable 0.27.0
  • react-moveable 0.30.0
  • preact-moveable 0.29.0
  • ngx-moveable 0.23.0
  • svelte-moveable 0.18.0
  • lit-moveable 0.4.0
  • vue-moveable 2.0.0-beta.2
  • vue3-moveable 0.2.0

moveable's new version is released. Check it again.

You can use:

hideDefaultLines={true}

daybrush avatar Nov 16 '21 16:11 daybrush

I have the latest version of vue-moveable that is published (1.8.11) and this is my configuration on vue: moveable: { hideDefaultLines: true, draggable: true, pinchable: true, throttleDrag: 0.2, resizable: false, throttleResize: 1, keepRatio: true, scalable: true, throttleScale: 0, rotatable: true, throttleRotate: 0, }

this doesn't hide the lines. if I manually install the new 2.0.0 beta version, vue-moveable stops working entirely.

What should I do?

aayush801 avatar Nov 16 '21 17:11 aayush801

@aayush801

From 2.0.0, the method of using Moveable is different.

<template>
<div class="container">
    <div class="target">Vue Moveable</div>
    <Moveable
        className="moveable"
        v-bind:target="['.target']"
        v-bind:draggable="true"
        v-bind:scalable="true"
        v-bind:rotatable="true"
        @drag="onDrag"
        @scale="onScale"
        @rotate="onRotate"
    />
</div>
</template>
<script>
import Moveable from 'vue-moveable';

export default {
  name: 'app',
  components: {
    Moveable,
  },
  methods: {
    onDrag({ transform }) {
      target.style.transform = transform;
    },
    onScale({ drag }) {
      target.style.transform = drag.transform;
    },
    onRotate({ drag }) {
      target.style.transform = drag.transform;
    },
  }
}
</script>

daybrush avatar Nov 16 '21 17:11 daybrush

thanks this works for the default lines issue. Is there a way to remove the rotatable and resizing dots too ? Capture

the lines are gone, is there a similar option for the dots ?

is there any documentation for this new version?

aayush801 avatar Nov 16 '21 18:11 aayush801

@aayush801

Set props

renderDirections={[]} rotationPosition="none"

daybrush avatar Nov 16 '21 18:11 daybrush

setting these props makes it work for the resizable buttons but not for the rotation button.

image

all the lines and sizing buttons are gone only the rotation one remains as you can see.

<Moveable className="moveable" v-bind:target="['.target']" v-bind:draggable="true" v-bind:scalable="true" v-bind:origin="false" v-bind:renderDirections="[]" v-bind:rotationPosition="none" v-bind:hideDefaultLines="isPreview" v-bind:rotatable="true" @drag="handleDrag" @scale="handleScale" @rotate="handleRotate" @warp="handleWarp" />

this is my config

is it possible to remove this too?

aayush801 avatar Nov 16 '21 18:11 aayush801

Maybe it's a typo here. v-bind:rotationPosition="'none'"

daybrush avatar Nov 16 '21 20:11 daybrush

yes, it was, it's all working now. thank you so much !!

aayush801 avatar Nov 16 '21 22:11 aayush801

opacity = 0 😂

scqilin avatar Aug 14 '22 04:08 scqilin

@scqilin

hide it via css

.moveable-control.moveable-direction {
   opacity: 0!important;
}

daybrush avatar Aug 14 '22 12:08 daybrush