moveable icon indicating copy to clipboard operation
moveable copied to clipboard

Adding custom functions around moveable element

Open webAravis opened this issue 4 years ago • 8 comments

Environments

  • Framework name: Angular
  • Framework version: 10
  • Moveable Component version: 0.15.4
  • Testable Address(optional):

Description

Hello and thanks for this great package. Is there a way to add custom functions with their own markup, css and behavior like a custom delete icon on this post #246 ?

webAravis avatar Oct 21 '20 13:10 webAravis

@webAravis However, custom props cannot be used in angular, and css should be set to global. or use inline css.


customAble = {
   name: "customAble",
   always: true,
   props: {},
   events: {},
   render(moveable, React) {
    return React.createElement(...);
   },
};

[ables]="[customAble]"

daybrush avatar Oct 21 '20 16:10 daybrush

@webAravis I wrote a bit of documentation. https://github.com/daybrush/moveable/blob/master/packages/react-moveable/src/react-moveable/ables/README.md

daybrush avatar Oct 21 '20 16:10 daybrush

Thank you, I'll try it and tell you!

webAravis avatar Oct 22 '20 06:10 webAravis

Does it mean you need React renderer inside Angular to add custom ables to your moveables ?

negue avatar Feb 18 '21 17:02 negue

@negue

Yes. However, it does not import react. Use React as the second argument.

customAble = {
   name: "customAble",
   always: true,
   props: {},
   events: {},
   render(moveable, React) {
    return React.createElement(...);
   },
};

daybrush avatar Feb 20 '21 11:02 daybrush

@daybrush @webAravis How to use [ables] in Angular? If you have a example in angular please share, it will be great help.

Thanks in advance

iprasadg avatar May 09 '21 14:05 iprasadg

If you can please share examples of using Custom Able with vanilla would be great =)

faustort avatar Sep 28 '21 04:09 faustort

any updates on this, posted here too: https://github.com/daybrush/moveable/issues/1007

born2net avatar Sep 05 '23 08:09 born2net