Closed Bug 1682313 Opened 3 years ago Closed 3 years ago

Disconnected cloned textarea does not fire select events

Categories

(Core :: DOM: Selection, defect)

defect

Tracking

()

RESOLVED FIXED
86 Branch
Tracking Status
firefox86 --- fixed

People

(Reporter: saschanaz, Assigned: saschanaz)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

textarea = document.createElement("textarea");
textarea.textContent = "Foo";
clone = textarea.cloneNode(true);
clone.onselect = console.log;
clone.select();

Expected: Both should fire a select event
Actual: Only the first one should fire one

Cloning the element does not properly set the maxLength in SelectionProperties.

See Also: → 1679461

Cloning a textarea element without a dirty value flag does not call SetValue() and thus gets no max length. This makes sure it always gets one before setting selection range.

Assignee: nobody → krosylight
Status: NEW → ASSIGNED
See Also: 16794611680548
Pushed by krosylight@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/80e51db676d2
Make sure mMaxLength exists in SetSelectionRange r=masayuki
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/26902 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 86 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: