Page MenuHomePhabricator

Resizing textarea reduces its width in CodeMirror
Closed, ResolvedPublic3 Estimated Story PointsBUG REPORT

Description

What is the problem?

When I have CodeMirror enabled, if I resize the textarea, the width of div.CodeMirror reduces slightly (and the scrollbar moves to the left).

codemirror_resize.png (800Γ—1 px, 143 KB)

I can reproduce on Firefox and Chromium. Only when RTP is not enabled.

Steps to reproduce problem
  1. Edit a page (e.g. https://en.wikipedia.beta.wmflabs.org/w/index.php?title=BeforeEach-name-0.20468147312084506-I%C3%B1t%C3%ABrn%C3%A2ti%C3%B4n%C3%A0liz%C3%A6ti%C3%B8n&action=edit)
  2. Turn on the CodeMirror (little pen icon in the menu)
  3. Inspect the .CodeMirror element, record the width (using devtools)
  4. Resize the textarea (with the little thingy in the bottom left)
  5. Inspect the .CodeMirror element again, compare the width with what you recorded at 3

Expected behavior: They should be the same
Observed behavior: They are not

Environment

Browser: Firefox 91, Chromium 87
Wiki(s): https://en.wikipedia.beta.wmflabs.org MediaWiki 1.39.0-alpha (0a0e6e2) 13:17, 12 April 2022.
Editor, if applicable: WikiEditor 0.5.3 (85098ce) 06:15, 12 April 2022. CodeMirror 4.0.0 (758dd2c) 06:13, 12 April 2022.

Event Timeline

TheresNoTime changed the subtype of this task from "Bug Report" to "Task".Aug 1 2022, 8:26 PM
TheresNoTime changed the subtype of this task from "Task" to "Bug Report".
TheresNoTime changed the task status from Open to In Progress.Aug 4 2022, 10:47 AM

Change 820430 had a related patch set uploaded (by Samtar; author: Samtar):

[mediawiki/extensions/CodeMirror@master] ext.CodeMirror.js: Keep at 100% parent width

https://gerrit.wikimedia.org/r/820430

Change 820430 merged by jenkins-bot:

[mediawiki/extensions/CodeMirror@master] ext.CodeMirror.js: Keep at 100% parent width

https://gerrit.wikimedia.org/r/820430

I cannot reproduce this bug on Firefox, Chromium and Safari.

On Firefox, I tested resizing with and without RTP enabled on all 5 skins and also RTL.

Test environment: https://en.wikipedia.beta.wmflabs.org WikiEditor 0.5.3 (9e36644) 06:52, 11 August 2022. CodeMirror 4.0.0 (5061cc1) 11:54, 4 August 2022.
Test browsers: Firefox 91, Chromium 87, Safari 15.
Skins: Vector 2022, Vector 2010, Minerva, Timeless, MonoBook.

β€’ NRodriguez subscribed.

I cannot reproduce this bug on Firefox, Chromium and Safari.

The Dom has spoken! And I don't mean the Document Object Model <3

Tested on beta myself and also could not reproduce on Chrome.