Skip to content

Commit b9a7ddf

Browse files
committed
docs(select): add docs for static placeholder
1 parent d78a370 commit b9a7ddf

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/lib/select/select.md

+13
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,19 @@ class MyComp {
3737
}
3838
```
3939

40+
### Setting a static placeholder
41+
42+
It's possible to turn off the placeholder's floating animation using the `floatPlaceholder` property. It accepts one of three string options:
43+
- `'auto'`: This is the default floating placeholder animation. It will float up when a selection is made.
44+
- `'never'`: This makes the placeholder static. Rather than floating, it will disappear once a selection is made.
45+
- `'always'`: This makes the placeholder permanently float above the input. It will not animate up or down.
46+
47+
```html
48+
<md-select placeholder="State" [(ngModel)]="myState" floatPlaceholder="never">
49+
<md-option *ngFor="let state of states" [value]="state.code">{{ state.name }}</md-option>
50+
</md-select>
51+
```
52+
4053
#### Keyboard interaction:
4154
- <kbd>DOWN_ARROW</kbd>: Focus next option
4255
- <kbd>UP_ARROW</kbd>: Focus previous option

0 commit comments

Comments
 (0)