Cursor position when changing from design to html view

4 posts, 0 answers
  1. Amey
    Amey avatar
    34 posts
    Member since:
    Dec 2007

    Posted 20 Sep 2011 Link to this post

    I've noticed that when I switch from design view to HTML view, my cursor does not maintain my position in the html view.  Meaning when i'm halfway down a piece of text, and wish to inspect the underlying HTML, i'm not taken to that same place in the HTML - i'm taken back to the top of the content.  This can make it quite time consuming to go back and find my location.  Is there a way to maintain cursor position while switching views?
  2. Rumen
    Admin
    Rumen avatar
    14028 posts

    Posted 20 Sep 2011 Link to this post

    Hello Christian,

    Unfortunately the desired functionality is not easy to achieve and is not offered out-of-the box by RadEditor. You can try to save the selection range before the user changes the mode to HTML and restore it after he returns back to Design, but you need to consider that content might be changed. You can find helpful information on selection and ranges in the following site:
    Introduction to Range.

    Best regards,
    Rumen
    the Telerik team
    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 their blog feed now
  3. Amey
    Amey avatar
    34 posts
    Member since:
    Dec 2007

    Posted 20 Sep 2011 Link to this post

    Hi Rumen,

    It's OK if it's not restored when we go back to the Design view.  I just want the cursor to be in the same place when I switch to HTML view from Design view.
  4. Rumen
    Admin
    Rumen avatar
    14028 posts

    Posted 21 Sep 2011 Link to this post

    Hi Christian ,

    The requested feature is almost the same as selecting the same content / tag when toggling back from HTML mode to Design mode. Both modes are different iframes which means different documents and it is not trivial to restore the cursor position when changing the iframes when switching between different view modes. In addition, the content is parsed by the editor's content filters to make it valid XHTML. This process modifies the content and it is not possible to programmatically restore the selection.

    Have you seen by any chance another web based Rich Text Editor that supports this nice feature?

    Best regards,
    Rumen
    the Telerik team
    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 their blog feed now
Back to Top