<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>154496</bug_id>
          
          <creation_ts>2016-02-20 04:28:15 -0800</creation_ts>
          <short_desc>Only first character inserted into a element in contenteditable mode</short_desc>
          <delta_ts>2017-07-25 08:11:07 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>HTML Editing</component>
          <version>Safari 9</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>m.lewandowski</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>rniwa</cc>
    
    <cc>sinspiral</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1166721</commentid>
    <comment_count>0</comment_count>
    <who name="">m.lewandowski</who>
    <bug_when>2016-02-20 04:28:15 -0800</bug_when>
    <thetext>## Repro steps

1. Open http://codepen.io/mlewand/pen/obRKqM?editors=1100
1. Focus contenteditable div (marked with blue border)
1. Make a selection containing at least one character at the end of link e.g. `&lt;a href=&quot;#&quot;&gt;bar baz [bom]&lt;/a&gt;`
1. Type &quot;aaa&quot;

### Expected

Link inner text is changed to `&lt;a href=&quot;#&quot;&gt;bar baz aaa&lt;/a&gt;`.

### Actual

Only first character gets into the link, any subsequent will be placed outside the anchor.


### References

This issue has been picked up by Drupal community https://www.drupal.org/node/2671896.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1166722</commentid>
    <comment_count>1</comment_count>
    <who name="">m.lewandowski</who>
    <bug_when>2016-02-20 04:29:19 -0800</bug_when>
    <thetext>This issue does not appear in FF, IE11. It&apos;s also buggy in Chromium.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1166885</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2016-02-21 16:42:09 -0800</bug_when>
    <thetext>Could you please elaborate on why you are calling this a bug?

The behavior is consistent with what happens when typing right after a link (which is also different from Firefox).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1166988</commentid>
    <comment_count>3</comment_count>
    <who name="">m.lewandowski</who>
    <bug_when>2016-02-22 04:02:40 -0800</bug_when>
    <thetext>Sure, I think there is misunderstanding:

It&apos;s not that you&apos;re typing after the link, but your selection is still *within* the link.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1166989</commentid>
    <comment_count>4</comment_count>
    <who name="">m.lewandowski</who>
    <bug_when>2016-02-22 04:03:51 -0800</bug_when>
    <thetext>Here&apos;s a reference to this issue in Chromium tracker: https://bugs.chromium.org/p/chromium/issues/detail?id=588418</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1167167</commentid>
    <comment_count>5</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2016-02-22 13:17:45 -0800</bug_when>
    <thetext>The selection is not within the link after the first keypress. It&apos;s not a coincidence that the first keypress works as you expect.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1177337</commentid>
    <comment_count>6</comment_count>
    <who name="">m.lewandowski</who>
    <bug_when>2016-03-23 06:26:01 -0700</bug_when>
    <thetext>Yes, selection is making its way out of the anchor element, and this is the source of the problem.

To have a better understanding of this issue look at it compared to any other inline element, such as bold here: http://codepen.io/mlewand/pen/ONmmmE?editors=1000

Cross linking yet another user request, this time in CKEditor&apos;s tracker http://dev.ckeditor.com/ticket/14506</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1331932</commentid>
    <comment_count>7</comment_count>
    <who name="Alberto Fernandez">sinspiral</who>
    <bug_when>2017-07-25 08:11:07 -0700</bug_when>
    <thetext>I&apos;m also suffering this bug. For me is even worse, since on my custom editor the user can edit the anchor links themselves.

This is an example of markup the user can end up with which gives the issues:
&quot;&lt;a href=&quot;#&quot; contenteditable=&quot;true&quot;&gt;&lt;b&gt;Select all the text and try to type more than two characters&lt;/b&gt;&lt;/a&gt;&quot;


Steps to Reproduce
------

 1. Open my live codepen at https://codepen.io/sinspiral/pen/xLbdqR
 2. Select all the text.
  * It doesn&apos;t matter if using Ctrl/Cmd+A, using the mouse, or the key arrows with Shift pressed.
 3. Type more than two characters, i.e. &quot;lorem ipsum&quot;

Expect
------
The new text typed will appear, so the content will be &quot;lorem ipsum&quot;.

Result
------

After the second character is pressed or the whole content dissappears, or only the first character happens. Then you cannot continue typing anymore.

Platform:
------

Webkit Browsers where I can reproduce it:
 * Safari Version: 10.1.2 (12603.3.8)
 * Chrome Version 59.0.3071.115 (Official Build) (64-bit)
 * PhantomJS: Version 2.1.1
 * QtWebkit (annulen): 5.212.0 Alpha 2

OS Version:
 * macOS 10.12.6
 * Windows 10</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>