Closed Bug 1964660 Opened 7 months ago Closed 5 months ago

Text selected with input.setSelectionRange() is not replaced when the next character is entered

Categories

(GeckoView :: IME, defect)

All
Android
defect

Tracking

(firefox143 fixed)

RESOLVED FIXED
143 Branch
Tracking Status
firefox143 --- fixed

People

(Reporter: hbenl, Assigned: m_kato)

References

Details

(Keywords: webcompat:platform-bug, Whiteboard: [fxdroid])

Attachments

(1 file)

When a text input's selection range is set using input.setSelectionRange(), the next character from the keyboard replaces the selected text in the Desktop version of Firefox but not in the Android version.
STR:

  1. Go to https://hbenl.github.io/test/input-set-selection-range/
  2. Click on the input (outside of the input's text)
  3. Enter some characters

The page shows input.value from an oninput handler and then resets input.value and calls input.setSelectionRange() again.
In Firefox desktop it always shows [<key>] but on Android it's [], [<key>***], [*<key>**] or [***<key>].

The severity field is not set for this bug.
:boek, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(jboek)
Assignee: nobody → m_kato
Component: Browser Engine → IME
Product: Firefox for Android → GeckoView
Whiteboard: [fxdroid]
Severity: -- → S3
Flags: needinfo?(jboek)

When updating text in Gecko, then the text isn't updated, we may ignore
next selection change to avoid unexpected selection change.

But if selection will not be collapsed, we shouldn't ignore it since
this is caused by web content's script.

Pushed by m_kato@ga2.so-net.ne.jp: https://github.com/mozilla-firefox/firefox/commit/a0bdfcb71d75 https://hg.mozilla.org/integration/autoland/rev/0caacbbd57c5 Update selection when selection is changed by web content even if text isn't changed. r=geckoview-reviewers,ohall
Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 143 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: