Moveable: Remove Rectangle After Removing Item

Created on 3 May 2020  路  12Comments  路  Source: daybrush/moveable

Environments

  • Framework name: Ionic
  • Framework version: 5.4.13
  • Moveable Component version: "^0.12.2"

Description


When I use multiple or single items, when I remove it, the blue rectangle around item still there
like attached photo

Capture

I try to use

 this.moveable.updateRect();

but nothing happens!
so, how I can delete an item with the rectangle around it ?!
and how can I control when to show the rectangle around an item as I want to show it after clicking on an item, and remove it when I leave the page?

Angular question solved

Most helpful comment

@Eiputoo , I've checked your situation, I had the same problem and I solved it by giving images an absolute position with Css
like
img { position: absolute }
and it worked for me

All 12 comments

@EmadAbdou

try below:

<ngx-moveable
[target]=null;
/>

@daybrush
Thanks for your concern,
I tried

this.moveable['moveable'].target = null;
this.moveable.target = null;

and it worked for me,
Also I'd like to thank you for this library it helped me alot in an important project

is there a way to not show it at the first time?

@ericmaicon

not set target initially

@EmadAbdou , Are the rest of the items moved when you delete one of them? I have this issue and you can check my situation, here is my link.
https://github.com/daybrush/moveable/issues/255#issue-630435191

@Eiputoo , I've checked your situation, I had the same problem and I solved it by giving images an absolute position with Css
like
img { position: absolute }
and it worked for me

@EmadAbdou
It's work for me too... Thank you so much. But after i upload images, before the moveable target is set, these images are overlap in one place because we are set them position absolute. How do yo solve this?

@Eiputoo

If you uploaded the image, you have to add it to an arbitrary location.

if it is not absolute, the position of all elements is affected by width, height, left,top`.

@daybrush

Sorry, What do you mean by "If you uploaded the image, you have to add it to an arbitrary location."?

@Eiputoo , if i understood you right, if you use one frame for all items, just you need to add frame for each item, the overlap problem because all items share one frame with the same attributes

@EmadAbdou
i see, Thank you for your explanation!

@Eiputoo , U R Welcome ^_^

Was this page helpful?
0 / 5 - 0 ratings

Related issues

adityakrshnn picture adityakrshnn  路  6Comments

pistell picture pistell  路  4Comments

scottsquirespix picture scottsquirespix  路  5Comments

ajinkya-dev picture ajinkya-dev  路  3Comments

ladifire picture ladifire  路  3Comments