mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 17:40:43 +08:00
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:
@ -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 () {
|
||||
|
Reference in New Issue
Block a user