DEV: adds expandedOnInsert option to sk (#19870)

Allows to display a select-kit component expanded by default.

Usage:

```
<SingleSelect
  @value={{this.value}}
  @content={{this.content}}
  @options={{hash expandedOnInsert=true}}
/>
```
This commit is contained in:
Joffrey JAFFEUX
2023-01-13 16:13:13 +01:00
committed by GitHub
parent 076b3a6514
commit f525f722ea
2 changed files with 22 additions and 0 deletions

View File

@ -188,6 +188,14 @@ export default Component.extend(
this.handleDeprecations();
},
didInsertElement() {
this._super(...arguments);
if (this.selectKit.options.expandedOnInsert) {
this._open();
}
},
click(event) {
event.preventDefault();
event.stopPropagation();
@ -296,6 +304,7 @@ export default Component.extend(
desktopPlacementStrategy: null,
hiddenValues: null,
disabled: false,
expandedOnInsert: false,
},
autoFilterable: computed("content.[]", "selectKit.filter", function () {