mirror of
https://github.com/discourse/discourse.git
synced 2025-04-09 20:00:49 +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}}
|
{{#if showCategoryAdmin}}
|
||||||
{{categories-admin-dropdown
|
{{categories-admin-dropdown
|
||||||
onChange=(action "selectCategoryAdminDropdownAction")
|
onChange=(action "selectCategoryAdminDropdownAction")
|
||||||
|
options=(hash
|
||||||
|
triggerOnChangeOnTab=false
|
||||||
|
)
|
||||||
}}
|
}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
@ -271,7 +271,8 @@ export default Component.extend(
|
|||||||
selectedNameComponent: "selected-name",
|
selectedNameComponent: "selected-name",
|
||||||
castInteger: false,
|
castInteger: false,
|
||||||
preventsClickPropagation: false,
|
preventsClickPropagation: false,
|
||||||
focusAfterOnChange: true
|
focusAfterOnChange: true,
|
||||||
|
triggerOnChangeOnTab: true
|
||||||
},
|
},
|
||||||
|
|
||||||
autoFilterable: computed("content.[]", "selectKit.filter", function() {
|
autoFilterable: computed("content.[]", "selectKit.filter", function() {
|
||||||
|
@ -140,7 +140,11 @@ export default Component.extend(UtilsMixin, {
|
|||||||
this._focusFilterInput();
|
this._focusFilterInput();
|
||||||
} else if (event.keyCode === 9) {
|
} else if (event.keyCode === 9) {
|
||||||
// Tab
|
// Tab
|
||||||
if (this.selectKit.highlighted && this.selectKit.isExpanded) {
|
if (
|
||||||
|
this.selectKit.highlighted &&
|
||||||
|
this.selectKit.isExpanded &&
|
||||||
|
this.selectKit.options.triggerOnChangeOnTab
|
||||||
|
) {
|
||||||
this.selectKit.select(
|
this.selectKit.select(
|
||||||
this.getValue(this.selectKit.highlighted),
|
this.getValue(this.selectKit.highlighted),
|
||||||
this.selectKit.highlighted
|
this.selectKit.highlighted
|
||||||
|
Loading…
x
Reference in New Issue
Block a user