White space only able to replace at the first line

5 posts, 0 answers
  1. Vinson
    Vinson avatar
    4 posts
    Member since:
    Dec 2018

    Posted 16 Dec 2018 Link to this post

    Hi,

    When I try to replace a white space in RadEditor, it only able to replace at the first line, second line and onwards are not able to replace.

    Step:

    1. Open 'Find And Replace' dialog.

    2. Go to 'Replace' tab.

    3. Enter a white space for 'Find' text box.

    4. Enter any character or word for 'Replace With' text box.

    5. Hit on 'Replace All' button.

    Notice that only the white spaces at the first line are able to replace. How do I avoid it? I am able to reproduce it in demo site: https://www.telerik.com/forums/aspnet-ajax/general-discussions?newThread=/forums/aspnet-ajax/general-discussions

     

    Thank you.

  2. Rumen
    Admin
    Rumen avatar
    14028 posts

    Posted 19 Dec 2018 Link to this post

    Hi Vinson,

    I tested the provided demo under latest Chrome and was unable to replicate the error. I've recorded my test in the following video. Can you please examine it and let me know if I am missing some step?

    Can you provide reliable reproduction steps for this issue? 

    Regards,
    Rumen
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Vinson
    Vinson avatar
    4 posts
    Member since:
    Dec 2018

    Posted 19 Dec 2018 in reply to Rumen Link to this post

    Hi Rumen,

    Thanks for your reply. There is a mistake in your testing, you should enter a white space in 'Find' text box and enter any character/word in 'Replace With' text box.

    I recorded my test in this video: https://www.screencast.com/t/LenScWIIZ

    Thank you.

  4. Rumen
    Admin
    Rumen avatar
    14028 posts

    Posted 20 Dec 2018 Link to this post

    Hi Vinson,

    Thank you for the video!

    The problem was verified and is due to the Find and Replace engine of Chrome that the dialog uses.

    To fix it, you can instruct the editor to use its built-in engine under Chrome. This engine is cross-browser but for compatibility reason only enabled in Edge. Here is how to proceed:

    1) Create a JS file for example named dialog.js and populate it with the following contents:

    dialog.js
    if (Sys && Sys.Application) {
        Sys.Application.add_init(function () {
            var $T = Telerik.Web.UI;
            var $Editor = $T.Editor;
            
            $Editor.EditorFindReplaceEngine.prototype._supportsFindAPI = function () {
     
                return false;
            }
        });
    }

    2) Set the DialogsScriptFile property to point to the dialog.js file

    <telerik:RadEditor ID="RadEditor1" runat="server" DialogsScriptFile="dialog.js">...

    3) Save the files, clear the browser cache and test the solution.

    Please test the solution and let me know how it works.

    Best regards,
    Rumen
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  5. Rumen
    Admin
    Rumen avatar
    14028 posts

    Posted 20 Dec 2018 Link to this post

    I also logged the problem in the public bug tracker https://feedback.telerik.com/aspnet-ajax/1380597-white-space-only-able-to-replace-at-the-first-line-when and updated your Telerik points for reporting it.

    Best regards,
    Rumen
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top