strange behaviour in DOM
Reported by
cristian...@gmail.com,
May 2 2017
|
|||
Issue descriptionUserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36 Steps to reproduce the problem: i built a div contenteditable where onkeypressed dom inside is changed. onevent preventdefault for default behaviour. 2 Normally it works correctly but it i add elements very fast instead to add the dom defined it add the dafault character. Js might be executed synch so i dont understand. What is the expected behavior? default char is not inserted , but custom node. What went wrong? default behaviour is not blocked Did this work before? N/A Chrome version: 55.0.2883.87 Channel: n/a OS Version: Flash Version: Shockwave Flash 25.0 r0
,
May 2 2017
i found a solution : window.getSelection().removeAllRanges();
,
May 2 2017
on blur window.getSelection().removeAllRanges(); might be executed automatically ?
,
May 2 2017
Are you able to provide a reproduction URI? (A jsbin or jsfiddle?)
,
May 9 2017
Mark "WontFix" since this is expected behavior. Typed character is inserted before *focused* selection or replaced *focused* selection. When changing DOM tree around selection in "keydown" event handler, selection can be cleared or loose focus on selection. |
|||
►
Sign in to add a comment |
|||
Comment 1 by cristian...@gmail.com
, May 2 2017