Typing newline in oxy_textArea

Oxygen general issues.
Topi
Posts: 3
Joined: Tue May 25, 2021 2:09 pm

Typing newline in oxy_textArea

Post 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
cristi_talau
Posts: 496
Joined: Thu Sep 04, 2014 4:22 pm

Re: Typing newline in oxy_textArea

Post 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
Topi
Posts: 3
Joined: Tue May 25, 2021 2:09 pm

Re: Typing newline in oxy_textArea

Post 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
Bogdan Dumitru
Site Admin
Posts: 142
Joined: Tue Mar 20, 2018 5:28 pm

Re: Typing newline in oxy_textArea

Post 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
Bogdan Dumitru
http://www.oxygenxml.com
Topi
Posts: 3
Joined: Tue May 25, 2021 2:09 pm

Re: Typing newline in oxy_textArea

Post by Topi »

Hello,

Thank you for the update!

Best,
Topi
Post Reply