Closed Bug 1660932 Opened 4 years ago Closed 3 years ago

contentEditable element scroll to top when cursor position changes by click

Categories

(GeckoView :: IME, defect, P1)

Unspecified
Android

Tracking

(firefox85 fixed)

RESOLVED FIXED
85 Branch
Tracking Status
firefox85 --- fixed

People

(Reporter: m_kato, Assigned: m_kato)

References

Details

(Whiteboard: [geckoview:m82][geckoview:m83][geckoview:m84])

Attachments

(1 file)

From https://github.com/mozilla-mobile/fenix/issues/14107. I guess that this is nsIDOMWindowUtils::ZoomToFocusedInput (https://searchfox.org/mozilla-central/rev/19c23d725f27d0989e4a60f36d64004cebb39736/dom/base/nsDOMWindowUtils.cpp#2563) issue or editor doesn't call SetInputContext.

At least, when we show software keyboard, content should scroll to visible position of caret.

Steps to reproduce

  1. Add contentEditable=true attribute on a div using dev tools
  2. Write something long so that element height should be more than device height.
  3. Change cursor position using click in bottom of the content.

You can use following gist to add html and content using dev tools.

https://gist.github.com/ujjwalmishra09/58c046ad288babfcc7b016e619b53881

Expected behavior

Element should not scroll on top.

Actual behavior

Element scrolls on top when cursor position changes by click

Just want to add that this bug makes using any web apps based on excellent tiptap editor impossible where other browsers work just fine.

TIA

Severity: -- → S3
Priority: -- → P1
Whiteboard: [geckoview:m82]
Whiteboard: [geckoview:m82] → [geckoview:m82][geckoview:m83]
Whiteboard: [geckoview:m82][geckoview:m83] → [geckoview:m82][geckoview:m83][geckoview:m84]
Assignee: nobody → m_kato

When show virtual keyboard, we calls ZoomToFocusedInput to scroll to focused
element. But this method only consider single line control. It means that this
doesn't scroll better position when focused element is multiple such as
content editable. Because we use element rectangle foo zoom to rect.

So I would like to change this for <textarea> and contenteditable.

If <textarea> or contenteditable, we should use caret frame to scroll to
better position.

Pushed by m_kato@ga2.so-net.ne.jp:
https://hg.mozilla.org/integration/autoland/rev/e9c758b96f46
Don't use element bounding for ZoomToFocusedInput when focused element isn't single line control. r=botond
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 85 Branch
Regressions: 1681211
Regressions: 1681019

Moving some cursor and key event bugs to the new GeckoView::IME component.

Component: General → IME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: