Skip to content

Commit b2ee6a3

Browse files
authored
refactor(ui5-textarea): rename property maxLength to maxlength (#1068)
BREAKING CHANGE: The property maxLength has been renamed to maxlength. Also, the attribute name is changed from max-length to maxlength.
1 parent 16377ce commit b2ee6a3

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

packages/main/src/TextArea.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ const metadata = {
103103
* @type {number}
104104
* @public
105105
*/
106-
maxLength: {
106+
maxlength: {
107107
type: Integer,
108108
defaultValue: null,
109109
},
@@ -113,8 +113,8 @@ const metadata = {
113113
* in the <code>ui5-textarea</code>.
114114
* <br><br>
115115
* If set to <code>false</code>, the user is not allowed to enter more characters than what is set in the
116-
* <code>maxLength</code> property.
117-
* If set to <code>true</code> the characters exceeding the <code>maxLength</code> value are selected on
116+
* <code>maxlength</code> property.
117+
* If set to <code>true</code> the characters exceeding the <code>maxlength</code> value are selected on
118118
* paste and the counter below the <code>ui5-textarea</code> displays their number.
119119
*
120120
* @type {boolean}
@@ -353,7 +353,7 @@ class TextArea extends UI5Element {
353353
leftCharactersCount;
354354

355355
if (this.showExceededText) {
356-
const maxLength = this.maxLength || 0;
356+
const maxLength = this.maxlength || 0;
357357

358358
if (maxLength) {
359359
leftCharactersCount = maxLength - this.value.length;
@@ -365,7 +365,7 @@ class TextArea extends UI5Element {
365365
}
366366
}
367367
} else {
368-
calcedMaxLength = this.maxLength;
368+
calcedMaxLength = this.maxlength;
369369
}
370370

371371
return {

packages/main/test/pages/TextArea.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -148,17 +148,17 @@ <h2>Text Area: Growing with initial rows 4 and growing up to 12</h2>
148148

149149
<section class="group">
150150
<h2>Text Area: growing with max length 20 characters </h2>
151-
<ui5-textarea id="ta-max-length" class="fixed-width" growing max-length="20" placeholder="Max length"></ui5-textarea>
151+
<ui5-textarea id="ta-max-length" class="fixed-width" growing maxlength="20" placeholder="Max length"></ui5-textarea>
152152
</section>
153153

154154
<section class="group">
155155
<h2>Text Area: max length 20 characters </h2>
156-
<ui5-textarea class="fixed-width" max-length="20" placeholder="Max length"></ui5-textarea>
156+
<ui5-textarea class="fixed-width" maxlength="20" placeholder="Max length"></ui5-textarea>
157157
</section>
158158

159159
<section class="group">
160-
<h2>Text Area: showExceededText with maxLength</h2>
161-
<ui5-textarea id="show-max-length" class="fixed-width fixed-height" max-length="20" show-exceeded-text placeholder="Max length and Show Exceeded Text"></ui5-textarea>
160+
<h2>Text Area: showExceededText with maxlength</h2>
161+
<ui5-textarea id="show-max-length" class="fixed-width fixed-height" maxlength="20" show-exceeded-text placeholder="Max length and Show Exceeded Text"></ui5-textarea>
162162
</section>
163163

164164
<section class="group">

packages/main/test/samples/TextArea.sample.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ <h3>Basic TextArea</h3>
1919
<section>
2020
<h3>TextArea with Maximum Length</h3>
2121
<div class="snippet">
22-
<ui5-textarea class="textarea-width" placeholder="Type no more than 10 symbols" max-length="10" show-exceeded-text></ui5-textarea>
22+
<ui5-textarea class="textarea-width" placeholder="Type no more than 10 symbols" maxlength="10" show-exceeded-text></ui5-textarea>
2323
</div>
2424
<pre class="prettyprint lang-html"><xmp>
25-
<ui5-textarea placeholder="Type some text" max-length="10" show-exceeded-text></ui5-textarea>
25+
<ui5-textarea placeholder="Type some text" maxlength="10" show-exceeded-text></ui5-textarea>
2626
</xmp></pre>
2727
</section>
2828

0 commit comments

Comments
 (0)