This is a migrated thread and some comments may be shown as answers.

Odd behavior when cut and paste in Firefox

3 Answers 68 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Amy
Top achievements
Rank 1
Amy asked on 13 Nov 2013, 04:15 PM
Hi,

We're recently began experiencing some odd behavior when cutting and pasting text in the RadEditor using Firefox (v25).  If you cut a line of text and paste in another area, then cut a different line of text and paste in another area, when you paste a break tag is added and you have to perform the paste command a second time.

For example, using Telerik's demo (https://demos.telerik.com/aspnet-ajax/editor/examples/overview/defaultcs.aspx)...
1.Cut the first word "RadEditor" at the beginning of the paragraph
2. paste the word "RadEditor" on the line after the paragraph
3. Cut some of the text anywhere in the paragraph (e.g., cut the word "spellchecker")
4. Past the cut text at the beginning of the paragraph where the word "RadEditor" used to be

You'll get a blank line inserted the first time, then if you past again the cut text will show up.  The above is just an example; it doesn't matter what text you cut/paste first, any text you cut/paste after that creates a blank line and requires you to paste again.  

Here's the HTML code from where I swapped the words "'Textbox" and "spellchecker" using cut/paste commands:
<h2 class="titleText">RadEditor for ASP.NET AJAX</h2>
<p style="text-align: justify;"><span style="font-size: 19px; color: #4f6128;"><strong>RadEditor</strong></span><span style="color: #4f6128;"> </span>is not simply an HTML<a href="#HTMLDescription"><sup>1</sup></a> Editor. It is what Microsoft chose to use in <strong>MSDN</strong>, <strong>CodePlex</strong>, <strong>TechNet</strong>, <strong>MCMS</strong> and even as an alternative to the default editor in <a href="http://www.telerik.com/products/aspnet-ajax/sharepoint.aspx">SharePoint</a>. Whether you need a mere<br />
spellchecker with Google-like Textbox , or a Word-like content authoring environment, the result is the same: clean <strong>XHTML</strong> output, fast rendering, widest cross-browser support, and <a href="http://www.telerik.com/products/aspnet-ajax/editor.aspx">tons of features</a>: <br />
<br />

You can see above where a break tag was inserted after the text "Whether you need a mere", it took performing the paste command a second time to get the word "spellchecker" to be pasted.

This happens with both the keyboard and browser menu commands.  

I tried the same thing in Chrome, but the cut/paste seems to work as expected.

Any thoughts or suggestions?
Thanks,
Amy

3 Answers, 1 is accepted

Sort by
0
Ryan
Top achievements
Rank 1
answered on 13 Nov 2013, 04:22 PM
I am experiencing the same issue with copy/paste in FF 25.
0
Ianko
Telerik team
answered on 14 Nov 2013, 12:49 PM
Hi Amy and Ryan,

Thank you for contacting the Telerik support.

The described problem is a known problem, which is already fixed and you can upgrade to the 2013 Q3 SP1 version of RadControls, which will be available for download tomorrow (12.14.2013).

Another solution is using the following example setup as a workaround until the official release:
<telerik:RadEditor ID="RadEditor1" runat="server">
</telerik:RadEditor>
  
<script type="text/javascript">
    var onBeforePaste = Telerik.Web.UI.RadEditor.prototype._onBeforePaste;
    Telerik.Web.UI.RadEditor.prototype._onBeforePaste = function (oEvent) {
        onBeforePaste.call(this, oEvent);
        if ($telerik.isFirefox) {
            this.getSelection().getRange().deleteContents();
        }
    }
</script>


Regards,
Ianko
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Amy
Top achievements
Rank 1
answered on 14 Nov 2013, 01:34 PM
Terrific news!  Thank you for such a prompt response.  :)
Tags
Editor
Asked by
Amy
Top achievements
Rank 1
Answers by
Ryan
Top achievements
Rank 1
Ianko
Telerik team
Amy
Top achievements
Rank 1
Share this question
or