mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 20:43:19 +08:00
DEV: adds triggerOnChangeOnTab option to select-kit (#9833)
Usage: ``` options=(hash triggerOnChangeOnTab=false) ``` This will prevent to select the row when pressing tab.
This commit is contained in:
parent
42229fecad
commit
05d8091bd3
|
@ -3,6 +3,9 @@
|
|||
{{#if showCategoryAdmin}}
|
||||
{{categories-admin-dropdown
|
||||
onChange=(action "selectCategoryAdminDropdownAction")
|
||||
options=(hash
|
||||
triggerOnChangeOnTab=false
|
||||
)
|
||||
}}
|
||||
{{/if}}
|
||||
|
||||
|
|
|
@ -271,7 +271,8 @@ export default Component.extend(
|
|||
selectedNameComponent: "selected-name",
|
||||
castInteger: false,
|
||||
preventsClickPropagation: false,
|
||||
focusAfterOnChange: true
|
||||
focusAfterOnChange: true,
|
||||
triggerOnChangeOnTab: true
|
||||
},
|
||||
|
||||
autoFilterable: computed("content.[]", "selectKit.filter", function() {
|
||||
|
|
|
@ -140,7 +140,11 @@ export default Component.extend(UtilsMixin, {
|
|||
this._focusFilterInput();
|
||||
} else if (event.keyCode === 9) {
|
||||
// Tab
|
||||
if (this.selectKit.highlighted && this.selectKit.isExpanded) {
|
||||
if (
|
||||
this.selectKit.highlighted &&
|
||||
this.selectKit.isExpanded &&
|
||||
this.selectKit.options.triggerOnChangeOnTab
|
||||
) {
|
||||
this.selectKit.select(
|
||||
this.getValue(this.selectKit.highlighted),
|
||||
this.selectKit.highlighted
|
||||
|
|
Loading…
Reference in New Issue
Block a user