Re: [whatwg] set input.value when input element has composition string

On Tue, Mar 1, 2011 at 5:18 PM, Makoto Kato <m_kato@ga2.so-net.ne.jp> wrote:
>
> On Safari 5, even if textbox has IME composition string, text into textbox
> can be replaced by DOM/script.  But other browser's behaviors are different,
> and this is no specification when textbox has composition string.  Although
> IE, Chrome and Opera keep composition string after value is replaced by DOM,
> each behavior is different.
>
> This is the result for this test on each browsers.  When textbox has IME
> composition string such as ABCDEFG, then script (textbox.value = "123";) is
> called, textbox becomes...
>
> 1. "123ABCDEFG" (ABCDEFG keeps composition state and caret is after G).
> 2. "123" (composition string is removed).
> 3. "ABCDEFG" (ABCDEFG keeps composition state and caret is after G).
>
> Which behavior is right?  1 is Opera 11, 2 is Safari 5, and 3 is Chrome 10
> and IE9.
>

You must have tested Chrome improperly.  We currently have a bug in Chrome.
 To see the bug, open the attached test and type "nihao" with Chinese IME on
Windows or Mac.  Then press down array key.  The text is replaced by henhao
but "henha" is still marked and looks as if I'm compositing "henha" but if I
continue to type "ma" still with IME, then I observe that "henhaomao" is
shown inside the input element.  Once this bug is fixed, Chrome's behavior
should match that of Safari 5.

- Ryosuke

Received on Wednesday, 2 March 2011 06:31:24 UTC