Page 1 of 1

Typing newline in oxy_textArea

Posted: Tue May 25, 2021 2:41 pm
by Topi
Hello,

I am making a Web Author framework for editing xml documents. I have an oxy_textArea form control to edit the text content in <mainDescription> as follows:

Code: Select all

metadata > mainDescription {
    content:oxy_textArea(
          edit, '#text',
          contentType, 'text/plain',
          rows, 12,
          width, 100%);
     visibility: -oxy-collapse-text;    
}
The problem is, I'm unable to type newlines into the text by pressing enter. Pressing the enter key simply does nothing when the caret is inside the text area. Ctrl-enter does nothing either. Interestingly, I can paste newlines into the text from the clipboard. Any idea on how to get the enter key to work?

Best,
Topi

Re: Typing newline in oxy_textArea

Posted: Wed May 26, 2021 11:39 am
by cristi_talau
Hello,

I managed to reproduce the issue. I registered an issue for it and we will update this forum post once it is implemented.

To fix this problem in your deployment you can paste the following code snippet in the JS code [1] of your framework:

Code: Select all

document.body.addEventListener('keydown', e => {
  if (e.keyCode === 13) {
    if (e.target.tagName === 'TEXTAREA') {
      e.stopPropagation();
    }
  }
}, true);
Best,
Cristian

[1] https://www.oxygenxml.com/doc/versions/ ... _framework

Re: Typing newline in oxy_textArea

Posted: Fri Jun 04, 2021 11:16 am
by Topi
Thanks Cristi, that does the job!

Sorry for the late reply, somehow I didn't notice your reply.

In the meantime I managed to modify the function

Code: Select all

sync.formctrls.TextEnhancer.prototype.enterDocument = function(a) {
in workspace.js to get a temporary solution.

Again, thanks :)

Best, Topi

Re: Typing newline in oxy_textArea

Posted: Mon Oct 18, 2021 5:09 pm
by Bogdan Dumitru
Hello,

We have just released version 24 of Web Author that fixes the problem you reported. Thank you again for reporting it.

For more information on the enhancements made on this new version you can checkout the What's New section from our website [1].

[1] https://www.oxygenxml.com/xml_web_author/whats_new.html

Best Regards,
Bogdan Dumitru

Re: Typing newline in oxy_textArea

Posted: Tue Oct 19, 2021 7:52 am
by Topi
Hello,

Thank you for the update!

Best,
Topi