unlayer / react-email-editor

Drag-n-Drop Email Editor Component for React.js
https://unlayer.com/embed
MIT License
4.51k stars 728 forks source link

Custom UI for Merge Tags remove autocomplete when typing #407

Open willianjusten opened 2 months ago

willianjusten commented 2 months ago

Hey o/

So, I needed a more robust version for Merge Tags, since just the Select Box was too simple for my case (since I need to provide search), using the unlayer.registerCallback('mergeTag', fn()) worked fine, but I noticed that now the autocomplete box doesn't show up if I type { in the body as before.

Follow bellow how it was before.

image

I'd say that both features are different, we shouldn't remove this box option if we have a Custom UI when picking.

willianjusten commented 1 month ago

@brunolemos , anything about this?

Explaining a bit more:

unlayer.registerCallback('mergeTag', (_, done) => {
      toggleUserPropertiesModal();
      setMergeTagSelect(() => done);
    });

This works fine, when I click the User Properties on the Text menu, it opens my modal:

image

My problem is that before, when typing { inside the text, it would open the menu, based on the autocomplete menu trigger: https://docs.unlayer.com/docs/merge-tags#autocomplete-menu-trigger

Since I don't have the menu anymore (but the Modal), I'd like to open the same modal. Is there a listener that I should register to do that?