luwes / luwes/selectlist-polyfill

Selectlist without enabled options throws error

Open
#11 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
59
Forks
2
PR merge metrics
No merged PRs in 30d

Description

A selectlist without options or with disabled options only will throw `Cannot set properties of undefined (setting 'tabIndex')` error. [Selectlist expects to have at least one enabled input.](https://github.com/luwes/selectlist-polyfill/blob/b962b6e84476ebb453002388de2c05cd58e2ea95/src/selectlist.js#L441)
[Reproduction](https://stackblitz.com/edit/web-platform-t65p3h?file=index.html) - click on the selectlist.

Expected behavior:
It should open just an empty popover? 🤔 Not sure about the specs, the select opens an empty list of options.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at src/selectlist.js around line 441 and reproduce the error using the linked StackBlitz example, especially with no options and with only disabled options. Check the selectlist specification to determine the expected empty-popover behavior, then confirm the fix no longer throws when the list has no enabled inputs.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.