Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    May 2004
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Mac Mozilla loses cursor in editable doc

    Howdy,

    I am taking the body.innerHTML of an iframe, doing some formatting to it and then tossing it back into iframe body.innerHTML.

    I then use this code to get the cursor back to where it use to be:

    Code:
    //Setup selection range
    range = document.createRange();
    
    //Select the target node
    range.selectNode(targetNode);
    
    //Get the selection in the window
    sel = ifObj.cw.getSelection();
    
    //Collapse to the start of the node;
    sel.collapseToStart();
    
    //Extend the selection range to our previously set offset value
    sel.extend(targetNode,targetPoint);
    
    //Now we collapse to that point
    sel.collapseToEnd();
    This works great, execpt for one small issue. If you are using mozilla on a mac the cursor doesn't show up visually to the user. It is there, you can start editing and stuff fine, but the cursor isn't displayed.

    The cursor only seem to display if you click on the iframe with the mouse.

    Has anyone ran into this problem?

    On the pc using mozilla the cursor stays visible.

  • #2
    New Coder
    Join Date
    May 2004
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    duct tape solution

    Well here is how I get around for now.

    On the mac running mozilla you have to lose focus on the iframe window and then reapply focus to it.

    However if you just use blur() any other windows that are open flash just before focus() is called. So I made a hidden input field that I give focus to and then I give my iframe window focus again. That makes the cursor show up where I had placed with the code mentioned above.

    The more I work with mozillas built in editor the more I think it is really really broken.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •