Tab with a text editor directly in the text box

I used several rich text / wysiwyg editors in one of my projects ( tinyMCE and markitup ). Currently, I am using the latest version of markitup and its wonderful one, however it makes the mouse be in the form of navigation due to the fact that you cannot insert a tab above into the real text area, it only starts to navigate through parameters, for example, bold, italics, etc. .d.

I see that here, in stackoverflow, you can enter a tab from the header entry into the body text box with one tab, the same in gmail. Is there a way to do this using jQuery / javascript or is there something simple.

Hi

Luke

+3
source share
2 answers

Thanks Marco for giving me this idea. It was a very simple solution at the end, there is this code around line 160 jquery.markitup.css

li = $('<li class="markItUpButton markItUpButton'+t+(i)+' '+(button.className||'')+'"><a href="" '+key+' title="'+title+'">'+(button.name||'')+'</a></li>')
    .bind("contextmenu", function() { // prevent contextmenu on mac and allow ctrl+click
    return false;
    }).click(function() {

Changing attitudes <a href=""and </a>to <spanand </span>with respect, and then change all references to "a" in the stylesheet to "span" and the addition of the cursor: pointer, it seems, did the trick.

I hope someone using markitup finds this useful, and thanks again to Marco for the tip in the right direction

+3
source

I think Stack Overflows uses <li>+ javascript for buttons.

Of course, <li>they do not have tabindex, so they are not "accessible" elements.

tabindex = "- 1" , 100%, .

.

+1

Source: https://habr.com/ru/post/1753399/


All Articles