mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 20:08:49 +08:00
REFACTOR: s/focusAfterOnchange/focusAfterOnChange (#9801)
This commit is contained in:
@ -12,7 +12,7 @@
|
|||||||
options=(hash
|
options=(hash
|
||||||
popupTitle=b.title
|
popupTitle=b.title
|
||||||
icon=b.icon
|
icon=b.icon
|
||||||
focusAfterOnchange=false
|
focusAfterOnChange=false
|
||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
{{else}}
|
{{else}}
|
||||||
|
@ -271,7 +271,7 @@ export default Component.extend(
|
|||||||
selectedNameComponent: "selected-name",
|
selectedNameComponent: "selected-name",
|
||||||
castInteger: false,
|
castInteger: false,
|
||||||
preventsClickPropagation: false,
|
preventsClickPropagation: false,
|
||||||
focusAfterOnchange: true
|
focusAfterOnChange: true
|
||||||
},
|
},
|
||||||
|
|
||||||
autoFilterable: computed("content.[]", "selectKit.filter", function() {
|
autoFilterable: computed("content.[]", "selectKit.filter", function() {
|
||||||
@ -430,7 +430,7 @@ export default Component.extend(
|
|||||||
this.selectKit.close();
|
this.selectKit.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.selectKit.options.focusAfterOnchange) {
|
if (this.selectKit.options.focusAfterOnChange) {
|
||||||
this._safeAfterRender(() => {
|
this._safeAfterRender(() => {
|
||||||
this._focusFilter();
|
this._focusFilter();
|
||||||
this.popper && this.popper.update();
|
this.popper && this.popper.update();
|
||||||
|
@ -261,7 +261,7 @@ componentTest("prevents propagating click event on header", {
|
|||||||
|
|
||||||
componentTest("focusAfterOnChange", {
|
componentTest("focusAfterOnChange", {
|
||||||
template:
|
template:
|
||||||
"{{d-button class='focus-me'}}{{single-select options=(hash focusAfterOnchange=focusAfterOnchange) value=value content=content onChange=onChange}}",
|
"{{d-button class='focus-me'}}{{single-select options=(hash focusAfterOnChange=focusAfterOnChange) value=value content=content onChange=onChange}}",
|
||||||
|
|
||||||
beforeEach() {
|
beforeEach() {
|
||||||
this.setProperties({
|
this.setProperties({
|
||||||
@ -275,7 +275,7 @@ componentTest("focusAfterOnChange", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
async test(assert) {
|
async test(assert) {
|
||||||
this.set("focusAfterOnchange", true);
|
this.set("focusAfterOnChange", true);
|
||||||
|
|
||||||
await this.subject.expand();
|
await this.subject.expand();
|
||||||
await this.subject.selectRowByIndex(0);
|
await this.subject.selectRowByIndex(0);
|
||||||
@ -285,7 +285,7 @@ componentTest("focusAfterOnChange", {
|
|||||||
"it selects the header"
|
"it selects the header"
|
||||||
);
|
);
|
||||||
|
|
||||||
this.set("focusAfterOnchange", false);
|
this.set("focusAfterOnChange", false);
|
||||||
|
|
||||||
await this.subject.expand();
|
await this.subject.expand();
|
||||||
await this.subject.selectRowByIndex(0);
|
await this.subject.selectRowByIndex(0);
|
||||||
|
Reference in New Issue
Block a user