steveathon / bootstrap-wysiwyg

Tiny bootstrap-compatible WYSIWYG rich text editor
MIT License
661 stars 1.71k forks source link

Preventing tabulator #59

Closed timkley closed 8 years ago

timkley commented 8 years ago

Hi,

I have an application where I need to prevent tabulators, my code looks like the following:

$('#subject').wysiwyg({
    toolbarSelector: '',
    hotKeys: {}
});

$('#subject').on('keydown keyup', function(e) {
    if (e.keyCode == 13 || e.keyCode == 9) {
        e.preventDefault();
    }
});

When hitting enter it is being prevented like it should be, but a tab doesn't get prevented. Also providing an empty hotKeys parameter didn't change anything (in fact: none of the hotkeys get prevented?)

codewithtyler commented 8 years ago

I believe this is a bug with jQuery Hotkeys rather than with the editor itself.

steveathon commented 8 years ago

Does this happen in all browsers?

codewithtyler commented 8 years ago

I know it happens in Chrome, because I was able to replicate it the other day.

steveathon commented 8 years ago

Ok great - let's see if we can replicate it in FF and Safari, if so then we're likely going to need to raise it with that project as they don't currently have an open issue for it.

On Wed, Sep 30, 2015 at 10:33 AM, Tyler Hughes notifications@github.com wrote:

I know it happens in Chrome, because I was able to replicate it the other day.

— Reply to this email directly or view it on GitHub https://github.com/steveathon/bootstrap-wysiwyg/issues/59#issuecomment-144484767 .