Little improvements in a Rich Text

Hi!, How’re you?

I have a question…

Could WeWeb create a rich text embedded variable (or state) that captures the selected text every time? This would be wonderful for rich text features such as cutting text, copying, pasting, and deleting…

I say this because in text editing apps there are buttons in the top menu that perform these functions (like Google Docs) and the selected text is essential for the implementation of these features.

Thanks in advance

PS. I’m really someone who doesn’t have much notion of code and I have some difficulty in putting certain Javascript functions in WeWeb Formulas (it’s more of a difficulty for me than for the platform, I think).

Hi,

Great suggestion, what do you want to do with this state ? I think it would be better if we can implement the missing action you want to perform on the selected text so you don’t have to write any javascript. What are the actions you would want to implement ?

Also, if we provide the selected text, does it will be enough if its only the next and not the html text (tags will not be included, it seems to not be possible with the library we use)

1 Like

Hi! Thanks for reply!

The application I’m creating has a text editor similar to MS Word/Google Docs. Using the selected text would serve to apply page styles individually (for example, in a paragraph the margin would be different from others) and also imitate the keyboard action of CTRL+X (cutting), CTRL+V (pasting), paste without formatting or delete the text and I confess that I don’t know how to do this via Javascript and there isn’t much specific study material for these cases.

Or create more states regarding text formatting (spacing between lines and between letters…)

If you prefer, we can talk individually to go over more details. I will be happy and honored to help with the evolution.

Thanks in advance!

Captura de tela 2023-12-14 125123

I created a product ticket with your feedback, I don’t know when we will be able to implement them but I keep it in mind. :slight_smile:

1 Like

Hello, @Alexis , @Joyce and company!

Do we have any news about our beloved Rich Text Input?

Furthermore, I would like to know if a few more things related to this element are possible:

  • I’m studying how to create the effect of pages in the element and I discovered that in G. Docs it uses OVERFLOW in CLIP (we don’t have this option in WeWeb). Can I ask for this overflow option? (Can modify X and Y)…

  • Along with overflow, I think it would be necessary to get the text size so that, when it reached the limit, a new item would be created, as if it were a “page 2”. In this case, it would be even more interesting if the element already had this option to separate pages and their count (I know it’s a lot to ask, but who knows? :rofl:)

If that’s not possible, could you help me work with custom code?

Thanks in advance
Best Regards,
:brazil:

Hello.

@Joyce @Alexis

I’m going to take advantage of the topic about Rich Text Input to ask something else: when I save the text from the Rich Text Input in Xano, even removing the “TRIM” filter from the database, Xano saves it without the HTML tags.

I need to compare the initial text (which is in Xano, therefore in a variable) with the text entered in Rich Text

The goal is to create an icon that shows whether the text needs to be saved or not. Remembering that, in order not to generate many API requests due to saving each modified character (which is ideal for word processors), the free plan would not suit me.

There is a trigger option in the “on init value change” workflow. How it works?

Another issue is with the sanitize() formula, which does not return an interesting value. Could you help me with this?

I really appreciate it in advance!

Best Regards

Hi @felipegranado,

The ticket is still open and unfortunately not prioritised yet

For the multiple page system I don’t think it could fit with the idea of our rich text element, we want to remain close to the library we are using under the hood and I didn’t find a right way to do it

I think having a gdoc like editor make sense but will probably come from our futur marketplace as people will be able to share their own creations

For your usecase issue I think there is multiple way to solve/improve it

  1. Its weird xano is removing html tags from the output, are you sure its not only a display issue (like xano may display the interpreted content but still have the html version in the database) ? There is probably a way to store it, else using the rich text editor make no sense as you will not be able to store the layout (header, paragraph etc)
  2. On init value change you can execute something after the first initialisation, for exemple you could use this to store the initial value in a variable and compare it on every on change event before making the update request
  3. Our rich text has a built in debounce system, you could use it to delay the update and not trigger the on change at every character but only when the user has stopped to write for some times, usually 200-400ms depending of your average user typing speed

I’m not sure to understand your question about the sanitize formula, it’s made to escape html and make it not interpretable, useful when you want to make something entered by your user safe to display in a web page

1 Like