diff --git a/addon/components/base/bs-button.js b/addon/components/base/bs-button.js index 31f33b636..670b64a91 100644 --- a/addon/components/base/bs-button.js +++ b/addon/components/base/bs-button.js @@ -270,6 +270,8 @@ export default Ember.Component.extend(TypeClass, SizeClass, { } ); } + + return false; }, init() { diff --git a/tests/integration/components/bs-button-test.js b/tests/integration/components/bs-button-test.js index 84e12467d..0274161d3 100644 --- a/tests/integration/components/bs-button-test.js +++ b/tests/integration/components/bs-button-test.js @@ -143,3 +143,16 @@ test('clicking a button sends onclick action, if promise is returned from closur assert.equal(find('button').textContent, 'resolved'); }); + +test('clicking a button will prevent event to bubble up', async function(assert) { + let buttonClick = this.spy(); + this.on('buttonClick', buttonClick); + let parentClick = this.spy(); + this.on('parentClick', parentClick); + + this.render(hbs`
{{#bs-button onClick=(action "buttonClick")}}Button{{/bs-button}}
`); + + await click('button'); + assert.ok(buttonClick.called); + assert.notOk(parentClick.called); +});