Skip to content

Commit 268afff

Browse files
committedNov 6, 2024
fix bug exposed by eslint fix
1 parent 364beef commit 268afff

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed
 

‎addon/components/bs-button.hbs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<button
22
disabled={{this.__disabled}}
3-
type={{this.buttonType}}
3+
type={{this._buttonType}}
44
class="btn {{if @active "active"}} {{if this.block "btn-block"}} {{bs-size-class "btn" @size}} {{bs-type-class "btn" @type default=(if (macroCondition (macroGetOwnConfig "isBS3")) "default" "secondary") outline=@outline}}"
55
...attributes
66
{{on "click" this.handleClick}}

‎addon/components/bs-button.js

+7
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,13 @@ export default class Button extends Component {
164164
*/
165165
@arg buttonType = 'button';
166166

167+
get _buttonType() {
168+
if (this.args.buttonType === 'primary') {
169+
return 'submit';
170+
}
171+
return this.args.buttonType;
172+
}
173+
167174
/**
168175
* Set the 'active' class to apply active/pressed CSS styling
169176
*

‎tests/integration/components/bs-modal/footer-test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module('Integration | Component | bs-modal/footer', function (hooks) {
1818
assert.strictEqual(
1919
this.element.querySelector('.modal-footer button').getAttribute('type'),
2020
'button',
21-
'Submit button is of type submit.'
21+
'Submit button is of type button.'
2222
);
2323
assert.dom('.modal-footer button').hasText('close', 'Button title is correct.');
2424
});
@@ -31,7 +31,7 @@ module('Integration | Component | bs-modal/footer', function (hooks) {
3131
assert.strictEqual(
3232
this.element.querySelector('.modal-footer button:first-child').getAttribute('type'),
3333
'button',
34-
'Submit button is of type submit.'
34+
'Submit button is of type button.'
3535
);
3636
assert.dom('.modal-footer button:first-child').hasText('close', 'Close button title is correct.');
3737
assert.dom('.modal-footer button:last-child').hasClass('btn-primary', 'Submit button is a primary button.');

0 commit comments

Comments
 (0)