[Webkit-unassigned] [Bug 15256] Impossible to place an editable selection inside empty elements

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Nov 22 10:55:03 PST 2007


http://bugs.webkit.org/show_bug.cgi?id=15256


ap at webkit.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ap at webkit.org




------- Comment #4 from ap at webkit.org  2007-11-22 10:55 PDT -------
This problem doesn't only occur for empty text nodes - even if the node is not
empty, selection position is adjusted to start before its container.

I think I have a workaround that might work. It involves zero-width space:
                [<b>&#x200b;</b>]
...
        range.setStart( el.firstChild, 1 ) ;
        range.setEnd( el.firstChild, 1 ) ;

This positions the insertion point after the invisible space, and inside the
text child node.

Obviously, the space needs to be removed when the user starts typing, or clicks
somewhere else - otherwise, arrow navigation will not work incorrectly,
stopping at this position twice.

Please let us know if this works for you.


-- 
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list