Closed Bug 1624531 Opened 4 years ago Closed 4 years ago

Selected text changes selection when switching to multi-line editor mode

Categories

(DevTools :: Console, defect, P3)

Desktop
All
defect

Tracking

(firefox-esr68 unaffected, firefox-esr78 wontfix, firefox74 wontfix, firefox75 wontfix, firefox76 wontfix, firefox77 wontfix, firefox78 wontfix, firefox79 verified)

VERIFIED FIXED
Firefox 79
Tracking Status
firefox-esr68 --- unaffected
firefox-esr78 --- wontfix
firefox74 --- wontfix
firefox75 --- wontfix
firefox76 --- wontfix
firefox77 --- wontfix
firefox78 --- wontfix
firefox79 --- verified

People

(Reporter: atrif, Assigned: nchevobbe)

References

Details

(Keywords: regression)

Attachments

(2 files)

Attached video selection_devtools.mkv

Affected versions

  • 76.0a1 (20200323092419)
  • 75.0b7 (20200322132212)
  • 74.0 (20200309095159)

Affected platforms

  • Windows 10 x64
  • Ubuntu 18.04
  • macOS 10.15

Steps to reproduce

  1. Open Firefox and Web Console.
  2. Paste a large expression (e.g: ` Spans with 'e': `+ Array.from(document.querySelectorAll("span")) .map(el => el.textContent) .filter(s => s.includes("e")) .join(" ").
  3. Select the expression (Ctrl+ A).
  4. Switch to multi-line editor mode and observe the selected text.
  5. Switch back to in line mode and observe the selected text.

Expected result

  • At step 4 and step 5, all text remains selected as expected.

Actual result

  • At step 4 the selection of the text is moved (not all text is selected as expected).
  • At step 5 the selection of the text remains like in multi-line editor mode (not all text is selected as expected).

Regression Range

  • Reproduced with 73.01 (20200217142647) as well. I will search for one ASAP if there is one.

Notes

  • Attached a screen recording with the issue.
Has Regression Range: --- → no
Has STR: --- → yes

Looks like the same issue as Bug 1622783. Let's see if this is fixed when we land it.

Depends on: 1622783

Bugbug thinks this bug is a regression, but please revert this change in case of error.

Keywords: regression

Attaching the pushlog when returning to in line editor mode the selected text remains all selected as expected (step5).
Last good revision: af62dfeb5c0eeb6e5bf5a8626f2556f3fa0d7cd2
First bad revision: 938ba43a3350c4f81a5ed152b02eb92f9e68c949
Pushlog:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=af62dfeb5c0eeb6e5bf5a8626f2556f3fa0d7cd2&tochange=938ba43a3350c4f81a5ed152b02eb92f9e68c949

For Step4 I think the issue is not a regression, the selection changes when entering editor mode while having a large expression selcted.

Has Regression Range: no → yes
Priority: -- → P3

Because this bug's Severity has not been changed from the default since it was filed, and it's Priority is P3 (Backlog,) indicating it has been triaged, the bug's Severity is being updated to S3 (normal.)

Severity: normal → S3

This patch adds a ResizeObserver to the input node, which when triggered
refreshes the codeMirror instance.
This is needed because codeMirror draws specific elements, like the cursor
and selection blocks, and they need to be re-computed if the editor size
changed (the line might have wrapped, and the cursor need to be in a new
position now).

Depends on D78649

Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8560f76ca248
Refresh codeMirror instance when input is resized. r=Honza.
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 79

Verified the issue using Firefox 79.0a1 (20200622093309) on Windows 10x64, macOS 10.12 and Ubuntu 18.04. The text is no longer selected after switching to multiline/single line editor mode.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: