Problem with the Richtext-Editor

So, for everybody who is interessted, and do not want to search for a custom solution in this shitty “RichTextField”, how to send Text without to press a created “send”-button on your page, instead doing it via KEYBOARD.

Here is the solution.

  1. The ENTER-Key in the RTF will just be recogniced by system in COMBINATION with ----> “TAB” or the key between “ESC” and “TAB”. Just this 2 keys are working.

  2. First i thought the TAB-KEY would not be the better choice, because, while pressing TAB+ENTER, the focus goes to menue of RTF (looses focus of textfield).

  3. Using the other mentioned key in combination with ENTER, also has his own problems (you can test all this things in a normal RTF or in my comment-box, where i have also integrated some special analysing tools, for better detecting, whats going on) :grin:

  4. Ok, at the end, i desided to use the “TAB”-key again, because i found a very simple way, how to solve it (after 3-DAYs of SEARCH xD).

This is the very important code-snipet, which allows to send a message out from the RTF without pressing a button on the page (with mouse), instead doing it with your keyboard.

if(pressedKey==="Enter"){console.log("ENTER pressed")
        saveComment()
        .then(()=>{
            $w('#TXT').value= " "   //setting value to "" in RTF
            $w('#dataset1').refresh()
            setTimeout(()=>{$w('#RTXT0').focus()},50)
            //back-focus to the RTF-text-field
        })
    }

An working example you will find here…(on the very bottom of the page)

https://russian-dima.wixsite.com/meinewebsite