mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 03:58:34 +08:00
FIX: prevents click on sk header to bubble (#9084)
This commit is contained in:
parent
d05142d3f7
commit
ed85cfe141
|
@ -13,6 +13,7 @@ export default Component.extend(UtilsMixin, {
|
|||
return;
|
||||
if (this.eventType !== "click" || event.button !== 0) return;
|
||||
this.selectKit.toggle(event);
|
||||
return false;
|
||||
},
|
||||
|
||||
classNames: ["select-kit-header"],
|
||||
|
|
|
@ -238,3 +238,22 @@ componentTest("selected value can be 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…
Reference in New Issue
Block a user