FIX: prevents click on sk header to bubble (#9084)

This commit is contained in:
Joffrey JAFFEUX
2020-03-02 20:06:02 +01:00
committed by GitHub
parent d05142d3f7
commit ed85cfe141
2 changed files with 20 additions and 0 deletions

View File

@ -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);
}
});