Skip to content

Add nullable option to allow passing null/undefined as option#15

Open
TorsteinHonsi wants to merge 12 commits intomainfrom
nullable
Open

Add nullable option to allow passing null/undefined as option#15
TorsteinHonsi wants to merge 12 commits intomainfrom
nullable

Conversation

@TorsteinHonsi
Copy link
Contributor

@TorsteinHonsi TorsteinHonsi commented Mar 16, 2026

Added nullable option to allow passing null as option. Closed #8.

Run the nullable.html fixture for demo.

To do

  • Better looking Boolean control. Consider a tri-state version of the current toggle, with an intermediate position.
  • Animation when turning on/off. Apparent on the range slider.
  • Change behaviour a bit.
    • Instead of an on/off toggle for nullish, make it a stateless button that just sets the control to null. Then users can interact with the control any time to set it back to an explicit value. This goes for Text, Color and Number controls.
    • In Text and Number controls, print null (low-contrast, narrow text) as a placeholder to make it clear what it is. Consider this also for Color and Select.
  • Consider passing undefined instead of null to the options. Better fit with TS. Option? nullable: 'null'|'undefined'|true
  • Larger icon?
  • Web component API
  • Tests and docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for undefined in selects

1 participant