Empty textarea styled "line-height:1px;" on zoom 50% doesn't receive key inputs.
Reported by
andreabo...@gmail.com,
Aug 4
|
||||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.84 Safari/537.36 Steps to reproduce the problem: 1. open the fiddle at http://jsfiddle.net/u3wx0vsp/5/ with zoom 100% 2. open browser console 3. press the button focus textbox and type 4 observe that for each key press you see an input event 5 empty the texbox and refocus it, and type again 6 observe that events still fire trigger bug: 7 set browser zoom to less than 100% 8 empty the textbox or restart the page, focus the textbox and type 9 observe that no events are fired in console. If some text is in the console, the events will fire anyway, but as long as it gets empty under 100% zoom it won't accept input or simply fire input events. What is the expected behavior? input events always fire What went wrong? input events do not fire Did this work before? N/A Does this work in other browsers? Yes Chrome version: 68.0.3440.84 Channel: stable OS Version: OS X 10.13.5 Flash Version:
,
Aug 4
oh the workaround is very useful to me, thanks. Sorry i did not simplify the case enough, but that is the use i make of the textarea, and i wanted to be sure that particular situation is captured when the big is eventually fixed.
,
Aug 6
,
Aug 6
,
Aug 7
Able reproduce the issue on reported chrome version #68.0.3440.84 on Ubuntu 17.10. Note: The issue seems specific to Linux, as it is not reproduced on Mac 10.13.5 and Windows 7 As per comment #1, assigning it to the yoichio@ for further inputs on this issue. yoichio@ :Please confirm the issue and help in re-assigning if it is not related to your change. Thanks.!
,
Aug 7
my submitted test case is reproducible on MACOSX. I ll try a windows machine too.
,
Sep 25
No textarea shows at the fiddle. If the element is not layouted, no focus on the element. I don't understand the intention of the code.
,
Sep 25
yoichio@, the textarea is small and transparent as you can easily see in the code, but it's focused. This setup is very often used to get the keyboard input for things like text editors or incremental search.
,
Sep 25
Is also not a layout problem too much. If the textare is invisible but does not have line-height: 1px, then everything works. Also the cause of the bug is zoom less than 100% and empty textbox. it means that something is off. If it should not fire the event, it should be either at any zoom level at any string length.
,
Sep 25
Thank you for providing more feedback. Adding the requester to the cc list. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Sep 26
I guess Blink doesn't focus a element that's height is less than 1px physically because nothing should be rendered. So, if a element has 1px height and you zoom less than 100%, like 90%, the height gets 1px*90% = 0.9px. To me, setting style="opacity: 0;" is enough to get user input while hidden its actual input. Also I think line-height:1px is hacky. Could you feedback more about what you want exactly while you want to avoid what? Maybe we can have better APIs for that.
,
Sep 26
Oh, I found it was more general. http://jsfiddle.net/3ej7xv8o/ Updated the description.
,
Sep 26
,
Sep 26
Memo: current Blink focusing code through VisiblePosition depends on LayoutObject's height: https://cs.chromium.org/search/?q=logicalheight+file:%5Esrc/third_party/blink/renderer/core/editing/+package:%5Echromium$&type=cs We should fix at least FrameSelection::SelectionHasFocus and editor_command.cc::EnabledVisibleSelection return true for such element but I guess many code around Editing assumes input target element has valid height,,,
,
Sep 26
Adding "body { zoom: 50% }" to <style> also causes this issue.
,
Sep 26
Also the strange part is that if you write at zoom 100 and write a word, then zoom at 50% it continue working. If the textarea gets edited then to no text, is not possible to edit anymore. I do not think rendering anything is important, but firing the events is.
,
Oct 9
Issue 892789 has been merged into this issue. |
||||||||||
►
Sign in to add a comment |
||||||||||
Comment 1 by woxxom@gmail.com
, Aug 4828 bytes
828 bytes View Download