Added placement property to sl-select (#687)

* added placement to sl-select

* sl-select placement: just allow top and bottom
This commit is contained in:
Buni48
2022-02-21 15:04:21 +01:00
committed by GitHub
parent 0922ee202a
commit b24ff33fe0
2 changed files with 34 additions and 0 deletions

View File

@@ -121,6 +121,12 @@ export default class SlSelect extends LitElement {
/** The select's label. Alternatively, you can use the label slot. */
@property() label = '';
/**
* The preferred placement of the dropdown panel. Note that the actual placement may vary as needed to keep the panel
* inside of the viewport.
*/
@property() placement: 'top' | 'bottom' = 'bottom';
/** The select's help text. Alternatively, you can use the help-text slot. */
@property({ attribute: 'help-text' }) helpText = '';
@@ -451,6 +457,7 @@ export default class SlSelect extends LitElement {
<sl-dropdown
part="base"
.hoist=${this.hoist}
.placement=${this.placement}
.stayOpenOnSelect=${this.multiple}
.containingElement=${this as HTMLElement}
?disabled=${this.disabled}