Open Bug 1917823 Opened 1 month ago Updated 38 minutes ago

text cursor positioning issues in textarea

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

Firefox 130
defect

Tracking

()

UNCONFIRMED

People

(Reporter: vincent-moz, Unassigned)

References

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:130.0) Gecko/20100101 Firefox/130.0

Steps to reproduce:

  1. I started to report an issue at https://www.austingroupbugs.net/bug_report_page.php (Online Pubs project chosen in the top-right menu).
  2. While I forgot to fill the "Desired Action" textarea, I submitted the issue.
  3. I got an error from the web site because I did not fill the "Desired Action" textarea. So I clicked on the Back button as suggested.
  4. I started to fill the "Desired Action" textarea.

Actual results:

At this time, when I wanted to edit my report, I noticed issues with the positioning of the text cursor in both "Description" and "Desired Action" textareas:

  • Clicking somewhere to change the cursor position in the same textarea did not work in general: the cursor was staying at the same position. However, clicking somewhere in the other textarea always put the cursor at the wanted position.
  • Moving the cursor with the arrow keys did not work in general: most often, the cursor was staying at the same position, but it sometimes jumped to the end of the textarea.

Note that entering new text was always working, IIRC.

This occurred for the submission of https://www.austingroupbugs.net/view.php?id=1856 but I cannot reproduce the problem when I try to edit another form at the above URL.

Expected results:

The cursor should move as expected.

Hmm, that's interesting, but I don't have access to this page. It looks like a focus issue (though it might be in layout).

Are you aware of somewhere publicly-accessible where I could try to reproduce something like that? Is it consistently reproducible for you?

Thank you.

Component: Layout: Form Controls → DOM: UI Events & Focus Handling
Flags: needinfo?(vincent-moz)

I can't reproduce the issue.

The page has standard textarea's (unlike many websites). In the source, I can see a few JS scripts:

<script type="text/javascript" language="JavaScript"><!--
  if(document.layers) {document.write("<style>td{padding:0px;}<\/style>")}
// --></script>

and

in head, and later

<!-- Autofocus JS -->
<script type="text/javascript" language="JavaScript">
<!--
	window.document.report_bug_form.category.focus();
-->
</script>
Flags: needinfo?(vincent-moz)

Thank you for your bug report! We can't make any progress on this without a way to reproduce the issue. If this happens again please reopen this, or file a new bug.

Status: UNCONFIRMED → RESOLVED
Closed: 1 month ago
Resolution: --- → WORKSFORME

I'm reopening the bug as I'm having the same problem on another website (assistance.ens-lyon.fr but it is private) with a single-line input. This seems to just be a display issue: the cursor bar remains at the same position, but when I enter text, the text appears where I clicked (thus not where the cursor bar appears).

The problem occurs only when I click while the form input already has the focus (so this matches what I've said in my original bug report). If I click somewhere else to remove the focus from the input, then click again somewhere in the input, the cursor appears at the right position. A second click in the input yields the issue.

The cursor keys do not change the position of the cursor bar, but they are taken into account if I enter text (which appears where te cursor should be).

This time, this is Firefox 131.0.2.

Status: RESOLVED → UNCONFIRMED
Resolution: WORKSFORME → ---
Attached video bug1917823.ogv

I've attached a video showing the issue:

  1. I click at the end of the input.
  2. I type "12", which appears as expected, and type Backspace twice.
  3. I type the Left key several times (but the cursor bar does not move).
  4. I type "12", which appears where the cursor should be; the cursor bar moves 2 characters to the left.
  5. I type Backspace twice, which removes "12", and the cursor bar is back at the end of the text.
  6. I repeat steps 3-5.

I can also reproduce this issue. It seems to be specific to Linux, or at least, I have never seen this problem on macOS but I have encountered it with some regularity on Linux (Kwin 5.27.11, Wayland). When it is triggered, it seems to affect only the inputs on a single page (other tabs and the address bar seem to keep working correctly). Reloading the affected page seems to fix things.

I feel like the bug may be some state management bug in text selection management code, possibly related to modifier key state. When glitched, selecting some text and then pressing Ctrl+C to copy causes the text selection to visually clear, as if I had pressed a key that would have replaced the selection.

I do not know what the specific triggering condition is. I have tried quite a bit to mash keys until Firefox breaks with no luck. I have seen this happen with at least GitHub comments and one other site.

hmm, sounds like this is same as bug 1924093, but I've never seen this bug on Windows. focus/selection code is almost completely cross-platform code. So, something wrong in Graphics or something else.

See Also: → 1924093
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: