Skip to content

Commit

Permalink
Button: content of inner button should not be replaced (T1211763) (#2…
Browse files Browse the repository at this point in the history
  • Loading branch information
Zedwag authored Apr 4, 2024
1 parent d501e82 commit 707aefe
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default class ButtonWrapper extends Component {
_initMarkup(): void {
super._initMarkup();

const $content = (this.$element() as unknown as dxElementWrapper).find('.dx-button-content');
const $content = (this.$element() as unknown as dxElementWrapper).find('.dx-button-content').first();
const $template = $content.children().filter('.dx-template-wrapper');
const $input = $content.children().filter('.dx-button-submit-input');

Expand Down
17 changes: 17 additions & 0 deletions packages/devextreme/testing/tests/Renovation/button.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,21 @@ QUnit.module('Props: template', {

assert.strictEqual(element.find('.dx-button-submit-input').length, 1, 'render submit input');
});

QUnit.test('content of inner button should not be replaced (T1211763)', function(assert) {
const $element = this.Button({
template() {
const $templateWrapper = $('<div>').addClass('dx-template-wrapper');

$('<div id="innerButton">').dxButton({
text: 'button content'
}).appendTo($templateWrapper);

return $templateWrapper;
}
});
const $innerButton = $element.find('#innerButton');

assert.notStrictEqual($innerButton.children().length, 0, 'inner button content is not empty');
});
});

0 comments on commit 707aefe

Please sign in to comment.