mirror of
https://github.com/discourse/discourse.git
synced 2025-02-23 07:00:56 +08:00
FIX: prevents click on sk header to bubble (#9084)
This commit is contained in:
parent
55a49d8494
commit
d5ab4776cd
@ -13,6 +13,7 @@ export default Component.extend(UtilsMixin, {
|
|||||||
return;
|
return;
|
||||||
if (this.eventType !== "click" || event.button !== 0) return;
|
if (this.eventType !== "click" || event.button !== 0) return;
|
||||||
this.selectKit.toggle(event);
|
this.selectKit.toggle(event);
|
||||||
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
classNames: ["select-kit-header"],
|
classNames: ["select-kit-header"],
|
||||||
|
@ -238,3 +238,22 @@ componentTest("selected value can be 0", {
|
|||||||
assert.equal(this.subject.header().value(), 0);
|
assert.equal(this.subject.header().value(), 0);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
componentTest("prevents propagating click event on header", {
|
||||||
|
template:
|
||||||
|
"{{#d-button icon='times' action=onClick}}{{single-select value=value content=content}}{{/d-button}}",
|
||||||
|
|
||||||
|
beforeEach() {
|
||||||
|
this.setProperties({
|
||||||
|
onClick: () => this.set("value", "foo"),
|
||||||
|
content: DEFAULT_CONTENT,
|
||||||
|
value: DEFAULT_VALUE
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
async test(assert) {
|
||||||
|
assert.equal(this.value, DEFAULT_VALUE);
|
||||||
|
await this.subject.expand();
|
||||||
|
assert.equal(this.value, DEFAULT_VALUE);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user