mjml icon indicating copy to clipboard operation
mjml copied to clipboard

Using `textable` components

Open mval1002 opened this issue 5 years ago • 5 comments

I've been trying to find a way to insert placeholder text into my template all day. I spent a long time trying to use the insertHTML method of the RTE, which I had some success with, but I couldn't restore the cursor position after closing the popup. Everything I tried, the cursor would jump to the beginning.

I then came across the textable property mentioned on the main GrapesJS git here: https://github.com/artf/grapesjs/issues/481 and on this mjml plugin git here: https://github.com/artf/grapesjs-mjml/issues/32

That does not seem to be cooperating either. I'm able to drag the component to the template, but it's then completely unusable. I can't move it, change it, delete it, or anything. It seems to only add to the column and not the text blocks, which I imagine is a part of the issue. Presumably, that's due to a difference between normal Text components and MJ-Text components, but I have no idea how to resolve that.

If anyone has any advice, I'd love to hear it! I'm indifferent to doing this through the textable components or through the RTE insert, so any clues to making either one work would be great

mval1002 avatar Dec 16 '19 21:12 mval1002

Hello, did you had any news on the way to do it via textable components ?

jcze91 avatar Jan 16 '20 16:01 jcze91

No, unfortunately, nothing I've tried has solved the problem I'm facing. Either with textable components or a text editor extension.

mval1002 avatar Jan 16 '20 16:01 mval1002

A solution I could think of is, to override the default Text.js Component with a new custom component which is similar to the Text Component from the root project, that it can handle the textable property in an mj-text element. But I have no idea how this could look like. Anyone else an idea?

AlexanderFinkbeiner avatar Jun 15 '21 05:06 AlexanderFinkbeiner

Hello everyone ! Did u have some news about this ?

I'm able to create a textable component, which could be dragged into an <mj-text>, but I can't drag it between words / letters: it's always putted on the beginning 👎🏻 (Of course it's fully working in a classic HTML template, without the MJML plugin).

I tried the solution proposed by @AlexanderFinkbeiner but I can't make it working... Any ideas @artf ?

Thanks and have a nice day !

Bran72 avatar Mar 23 '22 08:03 Bran72

Hi @artf! Almost 4 years later, it doesn't seem to be fixed... And there is a similar issue there opened more recently https://github.com/GrapesJS/mjml/issues/337

LcsGa avatar Nov 15 '23 12:11 LcsGa