The new terra-form-select always includes a "-Select-" option that lets the user clear the selection. We need a way for a consumer of the control to turn off this functionality, as it allows the user to leave a valid state and go to an invalid state.
(This was possible in the old terra-form/select.)
Allow the consumer of terra-form-select to indicate that the user is not allowed to clear a selection once it has been set/made.
The terra-form-select control always includes a "-Select-" option that lets the user clear the selection.
It might make sense to allow the - Select - option to be removed or set as a different value, etc. Here's an example of how we'd like to use it. We default to "All" so including a Select option doesn't make much sense.

The Select component will now receive a new prop 'isPlaceholderHidden'. This prop will determine if the clear option- Select - should be visible.
Prop | Type | Default | Description
------------ | ------------- | ------------ | -------------
isPlaceholderHidden | boolean | false | Indicates whether the clear option should be visible
import React from 'react';
import Select from 'terra-form-select';
<Select
name="foo"
defaultValue="b"
isPlaceholderHidden
>
<Select.Option value="m" display="moo" key="m" />
<Select.Option value="b" display="boo" key="b" disabled />
<Select.Option value="z" display="zar" key="z" />
</Select>
In case when isInvalid and isPlaceholderHidden both are true for the Select component, then the default option will be a blank option.
+1 on tech design. I wish I could think of a better name for the isClearSelectionHidden prop.
Maybe some variation of:
isPlaceholderDisabled, allowBlankSelection, isNullValueDisabled, allowInvalidSelection, removeNullValue, isNullValueHidden, isDefaultValueHidden
@bjankord @dkasper-was-taken changed the prop to isPlaceholderDisabled
How about isPlaceholderHidden?
+1
Resolved in #1229
JIRA created
Most helpful comment
How about
isPlaceholderHidden?