Bug 244987

Summary: contenteditable element does not completely surrender focus
Product: WebKit Reporter: Ahmad Saleem <ahmad.saleem792>
Component: HTML EditingAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ap, bfulgham, karlcow, rniwa, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: Unspecified   

Description Ahmad Saleem 2022-09-09 10:28:36 PDT
Hi Team,

Another diving into Chrome Monorail and came across a bug in contenteditable stealing focus:

Test Case - https://jsfiddle.net/nk5ft2h7/

Commit Link - https://src.chromium.org/viewvc/blink?view=revision&revision=153317

Chrome Bug - https://bugs.chromium.org/p/chromium/issues/detail?id=222546

_______

*** STEPS TO REPRODUCE ***

1) Follow the instructions of JSFiddle

2) Place caret inside "Edit Me!" and then click checkbox

<<< ACTUAL RESULT >>>

Caret is still visible in Safari 15.6.1

<<< EXPECTED RESULT >>>

Caret should not be visible

______

^^^ OTHER BROWSERS ^^^

Firefox Nightly 106 - showing "EXPECTED RESULT"
Chrome Canary 107 - showing "EXPECTED RESULT"

_____

I think fixing will bring Webkit more aligned with other browsers. Keep fixing them and making Webkit more awesome!

Thanks!
Comment 1 Alexey Proskuryakov 2022-09-09 12:44:28 PDT
This looks like part of bug 22261 to me. Which we consider a bug in other browsers mostly, but maybe some aspects are worth fixing in WebKit.
Comment 2 Ahmad Saleem 2022-09-10 06:18:22 PDT
I think it is definitely worth fixing at least some edge cases because it is quite famous bug, I believe (following Chrome Bug details):

Workaround since 2011 - https://gist.github.com/shimondoodkin/1081133

Which is also -> It's the top web search result for "webkit contenteditable workaround".

Just wanted to add more details. If it is duplicate of any other bug, please mark this as "DUPLICATE". Thanks!
Comment 3 Radar WebKit Bug Importer 2022-09-16 10:29:19 PDT
<rdar://problem/100032932>