moveable icon indicating copy to clipboard operation
moveable copied to clipboard

Bug: lost moveable control box reference

Open SidIcarus opened this issue 2 years ago • 5 comments

Environments

Description

Release 0.46.0 seems to have introduced a bug where the the movable control box reference is lost when selecting/deselecting multiple targets. When using it to click on single targets it uses the same element but upon selecting/deselecting multiple, it creates a new element. In turn, this end ups creating a lot of one-time use elements and you must always call getControlBoxElement() to have the correct reference.

Use-case

using inputs to modify the moveable control box when multiple targets are selected

SidIcarus avatar Sep 28 '23 21:09 SidIcarus

@SidIcarus

Your observation is correct.

Moveable is

Single (+ No Select) Group Individual Group

All three cases have different elements. Using the same element would require a very large amount of work and would be difficult. I'm not sure if I can solve it, but I'll try.

daybrush avatar Sep 30 '23 08:09 daybrush

@daybrush

It is reasonable to have different elements for each use case; that is, seeing three would make sense. But we don't see three elements, we see a new element for each change. Prior to 0.46 it did not appear to do that.

I presume the routes that could be taken are

  • one control box element
  • one control box element per use-case (3)
  • continuously created control box elements but removing the elements that are no longer used

thoughts?

SidIcarus avatar Oct 02 '23 18:10 SidIcarus

I think I can just use the moveable.getManager().state/getState() for managing the control box size.

Removing the elements that are no longer used would be great though.

SidIcarus avatar Oct 02 '23 20:10 SidIcarus

Hi, @daybrush, @SidIcarus I have the same issue with ngx-moveable v0.49.0. Whenever select multi-targets, moveable-control-box count is increased. So, ngx-moveable.moveable-control-box is not updated to top-left circle. It works good until ngx-moveable v0.42.0. I am going to obtain the top-left coordinate of the selected targets area. image

Can you please check and let me know a solution? Thank you

wen9218 avatar Dec 06 '23 14:12 wen9218

I am also seeing the same issue as @wen9218 please let us know if you need additional info and tx for a great lib!

born2net avatar Dec 06 '23 14:12 born2net