Closed Bug 1768469 Opened 2 years ago Closed 2 years ago

datalistItems[0] is undefined

Categories

(Toolkit :: Form Manager, defect)

defect

Tracking

()

VERIFIED FIXED
102 Branch
Tracking Status
firefox102 --- verified

People

(Reporter: thecount, Assigned: dlee)

Details

Attachments

(2 files)

Attached file test.html

This seems to be an issue with datalist, to test, just type in something that's not in the datalist, example "test"

When I do that in nightly, I see this console error.

TypeError: can't access property "comment", datalistItems[0] is undefined FormAutoComplete.jsm:465:9
    autoCompleteSearchAsync resource://gre/modules/FormAutoComplete.jsm:465

Looking at FormAutoComplete.jsm line 455 https://searchfox.org/mozilla-central/source/toolkit/components/satchel/FormAutoComplete.jsm#455

Maybe it just need to be if (datalistItems?.length) {? Not sure.

That sounds plausible.

Component: Layout: Form Controls → Form Manager
Product: Core → Toolkit

Looking at the this a bit deeper, it seems to look like the only impact from the error is a call to maybeNotifyListener(result); gets missed.

Assignee: nobody → dlee
Status: NEW → ASSIGNED
Pushed by dlee@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f7644db29296
Check the length of datalistItems r=sgalich
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 102 Branch
QA Whiteboard: [qa-102b-p2]

Reproducible on a 2022-05-09 Nightly build on macOS 11. Verified as fixed on Firefox 102.0b4(20220605185654) and Nightly 103.0a1(20220606212503) on Windows 10 x64, Ubuntu 20.04 and macOS 11.

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-102b-p2]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: