Page 1 of 1

Clipboard is adding '\n' instead of a line break

Posted: 16 Jul 2021, 12:31
by amit.ismartrecruit
Having issue with the clipboard copmonant where it is unable to convert \n into new line.

Here is the code in Xhtml:

Code: Select all

<p:commandButton id="cmdCopyQueAns" action="#{pc_inprocessBean.copyQueAns()}" immediate="true" 
 ajax="true" value="#{candidateLbl['scrQueAns.copy']}" styleClass="btn btn-primary" update=":frm:messages"/>
 
<pe:clipboard id="clipCopy" trigger="cmdCopyQueAns" action="copy" text="#{pc_inprocessBean.selectedCandVO.cndJobQueAns}"/>
Expected output:
Add your Email:abc@abc.com
Add your name:Abc
What i am getting:
Add your Email:abc@abc.com\n\nAdd your name:Abc
Any Idea on how to resolve this?

Re: Clipboard is adding '\n' instead of a line break

Posted: 16 Jul 2021, 13:25
by Melloware

Re: Clipboard is adding '\n' instead of a line break

Posted: 16 Jul 2021, 13:58
by amit.ismartrecruit
Okay i'm having same thing but still not working. Do i have to upgrade extension version? I'm using Primefaces Extensions 6.2.11

Re: Clipboard is adding '\n' instead of a line break

Posted: 16 Jul 2021, 14:00
by Melloware
Yep most likely this was fixed somewhere along the lines because I could not reproduce in PFE 8.0.4 so maybe ClipboardJS fixed the issue under the covers?

If you can create a reproducible test case using PrimeFaces Test I can investigate the issue but I was not able to reproduce it.

Re: Clipboard is adding '\n' instead of a line break

Posted: 19 Jul 2021, 07:23
by amit.ismartrecruit
I saw on the tags that test is available for 8.0 and 10.0 but we are using PrimeFaces 6.2.8.

Re: Clipboard is adding '\n' instead of a line break

Posted: 19 Jul 2021, 14:00
by Melloware
Yeah for PF 6.2 the last release of PFE was 6.2.10. When I tested that bug I was using 8.0.4 and could not reproduce. We don't release old versions of PFE so there will be no 6.2.11. We only keep up to date on the latest PF version.