Skip to content

Commit fb6d2cd

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

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/lib/select/select.md

+14
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,20 @@ 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+
*my-comp.html*
48+
```html
49+
<md-select placeholder="State" [(ngModel)]="myState" floatPlaceholder="never">
50+
<md-option *ngFor="let state of states" [value]="state.code">{{ state.name }}</md-option>
51+
</md-select>
52+
```
53+
4054
#### Keyboard interaction:
4155
- <kbd>DOWN_ARROW</kbd>: Focus next option
4256
- <kbd>UP_ARROW</kbd>: Focus previous option

0 commit comments

Comments
 (0)