diff --git a/packages/devextreme/js/ui/text_area.js b/packages/devextreme/js/ui/text_area.js index 8a682882d722..e24663494ff7 100644 --- a/packages/devextreme/js/ui/text_area.js +++ b/packages/devextreme/js/ui/text_area.js @@ -15,7 +15,6 @@ import TextBox from './text_box'; // STYLE textArea const TEXTAREA_CLASS = 'dx-textarea'; -const TEXTEDITOR_INPUT_CLASS = 'dx-texteditor-input'; const TEXTEDITOR_INPUT_CLASS_AUTO_RESIZE = 'dx-texteditor-input-auto-resize'; const TextArea = TextBox.inherit({ @@ -100,10 +99,7 @@ const TextArea = TextBox.inherit({ return $input; }, - _applyInputAttributes: function($input, customAttributes) { - $input.attr(customAttributes) - .addClass(TEXTEDITOR_INPUT_CLASS); - }, + _setInputMinHeight: noop, _renderScrollHandler: function() { this._eventY = 0; @@ -131,7 +127,6 @@ const TextArea = TextBox.inherit({ this._eventY = currentEventY; }, - _renderDimensions: function() { const $element = this.$element(); const element = $element.get(0); diff --git a/packages/devextreme/js/ui/text_box/ui.text_editor.base.js b/packages/devextreme/js/ui/text_box/ui.text_editor.base.js index 38e4a77c986c..8415b8bfc907 100644 --- a/packages/devextreme/js/ui/text_box/ui.text_editor.base.js +++ b/packages/devextreme/js/ui/text_box/ui.text_editor.base.js @@ -321,8 +321,13 @@ const TextEditorBase = Editor.inherit({ const inputAttributes = extend(this._getDefaultAttributes(), customAttributes); $input .attr(inputAttributes) - .addClass(TEXTEDITOR_INPUT_CLASS) - .css('minHeight', this.option('height') ? '0' : ''); + .addClass(TEXTEDITOR_INPUT_CLASS); + + this._setInputMinHeight($input); + }, + + _setInputMinHeight: function($input) { + $input.css('minHeight', this.option('height') ? '0' : ''); }, _getPlaceholderAttr() { diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.editors/textArea.markup.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.editors/textArea.markup.tests.js index 36e3635a3123..4edfc644a2da 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.editors/textArea.markup.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.editors/textArea.markup.tests.js @@ -113,6 +113,17 @@ QUnit.module('widget sizing render', () => { assert.equal(elementStyles.maxHeight, '30px', 'widget max-height is correct'); }); + + QUnit.test('textarea with height option should not have min-height inline style', function(assert) { + const $element = $('#textarea').dxTextArea({ + height: 50, + value: 'First' + }); + + const $input = $element.find(`.${INPUT_CLASS}`); + + assert.strictEqual($input.get(0).style.minHeight, '', 'min-height inline style is not defined'); + }); }); QUnit.module('aria accessibility', () => {