Skip to content

[select] Refine Select.Value placeholder API #2011

@atomiks

Description

@atomiks

Feature request

Summary

Currently <Select.Value placeholder="" /> represents the "initial" label before an item has been chosen, even if one was initially chosen on mount. It therefore conflates text shown when value == null, and the value during SSR pre-rendering (and now, in beta.0, before the popup is opened to grab the labels based on the default value).

Motivation

placeholder should only represent value == null, while the initial label when defaultValue or value is pre-selected (during SSR/client pre-mount) must be distinguished to prevent confusion.

In alpha.8, it only affected SSR pre-rendering (it was blank before hydration), but now with the perf improvements to Select, it also affects client rendering too (so it's always blank). As a result we made placeholder required instead of optional. Either way it must be specified manually.

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: selectChanges related to the select component.type: enhancementIt’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.

    Projects

    Status

    Recently completed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions