Вопрос

i'm having a problem with the nicEdit script. nicEdit is a javascript libray to set the html textareas of a webpage into Rich Text Format fields.

It works fine except that does not detect when i type the 'space' character. I google'd this and I didn't find any clue. I do exactly what is suposed to do to call the js function:

<script type="text/javascript" src="http://js.nicedit.com/nicEdit-latest.js"></script>
<script type="text/javascript">  
    bkLib.onDomLoaded(function() { nicEditors.allTextAreas({maxHeight:75}) });
</script>

Is someone having the same or similar problem, or know how to fix this?

edit: I tested it in Google-Chrome and Internet Explorer and the error persists in both.

Thank you very much for your time! :)

Это было полезно?

Решение 2

Not solved but guessed the cause of the problem:

I made a simple html document only with a textarea and the javascript invocation of the question and worked fine.

So obviously was not a configuration problem, was some kind of conflict with other javascript libraries i'm using (JQuery and jstree). That is the reason i found nothing on google about it >_<.

My solution was change the nicEdit to jWYSIWYG, a jquery based RTF, and all works fine now.

Другие советы

I had this same problem, and solved it as follows:

Problem: 'space' wasn't registering in nicEdit fields

Track-down: The actual problem was that a jquery ui feature (accordion in this case) had registered the 'keydown' event for the editors parent. This prevents the 'keypress' event from propagating to the editors registered 'keypress' event handler. I didn't dig deep enough to know why it was only the 'space' key that was failing to propagate.

Solution: I removed the 'keydown' event from the editors parent. in my case that required the following snippet:

$(".accBar,.accContent").unbind('keydown');

I hope this is helpful to someone.

Are you using a CSS reset? That was my problem - baseline.reset sets some things, particularly revolving around "white-space: normal" that messed up rich text editors. Primarily on windows only, even - so Firefox on mac will work fine, but Firefox on Windows will not be able to make space characters.

The issue was most likely the jsTree hotkey plugin was intercepting spaces and calling "preventDefault". See the issue here:

https://github.com/vakata/jstree/issues/363

Removing the hotkey plugin or commenting out the space hotkey from jsTree should solve the problem.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top