Editor getRange returns wrong range in Internet Explorer

3 posts, 1 answers
  1. Tyler
    Tyler avatar
    47 posts
    Member since:
    Nov 2013

    Posted 03 Oct Link to this post

    I'm using editor.getRange() function from the Editor Select event to get the current range of an element selected in the Editor.

    In Chrome the getRange() function returns the range I would expect.

    However in Internet Explorer the getRange() function return the wrong range. 

    Why does the same method return 2 different items? The html I'm using in the the editor is as below.

     

    <p style="text-align:left;"><strong></strong>Test the range of the following field <span class="dfw-IsMergeField dfw-EditorMergeField" contenteditable="false" data-iscollection="false" data-name="ApplicantAddress" data-path="Mallons.DomainFire.Models.MergeTemplates.FireCertTemplate.ApplicantAddress" id="mergeFieldButton" title="Applicant Address">ApplicantAddress</span> in Chrome and Explorer</p>
    <p> </p>

  2. Answer
    Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 04 Oct Link to this post

    Hi Tyler,

    I tested the getRange() method under IE11, Firefox and Chrome and I was unable to reproduce different results. Can you please take a look at the following video http://screencast.com/t/pLDe8tUhC and let me know how to reproduce the issue on my end?

    Here is my Dojo sample: http://dojo.telerik.com/@RumenJ/urAcE.

    Best regards,
    Rumen
    Telerik by Progress
     
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
     
  3. Kendo UI is VS 2017 Ready
  4. Tyler
    Tyler avatar
    47 posts
    Member since:
    Nov 2013

    Posted 04 Oct in reply to Rumen Link to this post

    I've found the problem and its not Kendo UI's fault. Its to do with Internet Explorer and not supporting some of the selected 'range' properties. 

    var editor = e.sender;
    var range = editor.getRange();
    var startNode = range.startContainer; //This works in IE
    var parentElement = startNode.parentElement; //This is NOT supported in IE

     

    Ive added a fiddler here showing this. Run it in chrome and you get 2 messages but only 1 in Internet Explorer.

    http://dojo.telerik.com/@Mallon/ekiTu

     

     

Back to Top