@vaadin/text-area 25.2.0-alpha10 → 25.2.0-alpha11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +11 -11
- package/src/vaadin-text-area-mixin.js +9 -5
- package/src/vaadin-text-area.js +0 -3
- package/web-types.json +1 -1
- package/web-types.lit.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/text-area",
|
|
3
|
-
"version": "25.2.0-
|
|
3
|
+
"version": "25.2.0-alpha11",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -35,19 +35,19 @@
|
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
38
|
-
"@vaadin/a11y-base": "25.2.0-
|
|
39
|
-
"@vaadin/component-base": "25.2.0-
|
|
40
|
-
"@vaadin/field-base": "25.2.0-
|
|
41
|
-
"@vaadin/input-container": "25.2.0-
|
|
42
|
-
"@vaadin/vaadin-themable-mixin": "25.2.0-
|
|
38
|
+
"@vaadin/a11y-base": "25.2.0-alpha11",
|
|
39
|
+
"@vaadin/component-base": "25.2.0-alpha11",
|
|
40
|
+
"@vaadin/field-base": "25.2.0-alpha11",
|
|
41
|
+
"@vaadin/input-container": "25.2.0-alpha11",
|
|
42
|
+
"@vaadin/vaadin-themable-mixin": "25.2.0-alpha11",
|
|
43
43
|
"lit": "^3.0.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@vaadin/aura": "25.2.0-
|
|
47
|
-
"@vaadin/chai-plugins": "25.2.0-
|
|
48
|
-
"@vaadin/test-runner-commands": "25.2.0-
|
|
46
|
+
"@vaadin/aura": "25.2.0-alpha11",
|
|
47
|
+
"@vaadin/chai-plugins": "25.2.0-alpha11",
|
|
48
|
+
"@vaadin/test-runner-commands": "25.2.0-alpha11",
|
|
49
49
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
50
|
-
"@vaadin/vaadin-lumo-styles": "25.2.0-
|
|
50
|
+
"@vaadin/vaadin-lumo-styles": "25.2.0-alpha11",
|
|
51
51
|
"sinon": "^21.0.2"
|
|
52
52
|
},
|
|
53
53
|
"customElements": "custom-elements.json",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"web-types.json",
|
|
56
56
|
"web-types.lit.json"
|
|
57
57
|
],
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "fdc37e932709f95491a027aeb2090911cb7528c6"
|
|
59
59
|
}
|
|
@@ -10,10 +10,6 @@ import { TextAreaController } from '@vaadin/field-base/src/text-area-controller.
|
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* A mixin providing common text area functionality.
|
|
13
|
-
*
|
|
14
|
-
* @polymerMixin
|
|
15
|
-
* @mixes InputFieldMixin
|
|
16
|
-
* @mixes ResizeMixin
|
|
17
13
|
*/
|
|
18
14
|
export const TextAreaMixin = (superClass) =>
|
|
19
15
|
class TextAreaMixinClass extends ResizeMixin(InputFieldMixin(superClass)) {
|
|
@@ -160,6 +156,7 @@ export const TextAreaMixin = (superClass) =>
|
|
|
160
156
|
}
|
|
161
157
|
|
|
162
158
|
const scrollTop = inputField.scrollTop;
|
|
159
|
+
const previousExplicitHeight = parseFloat(input.style.height);
|
|
163
160
|
|
|
164
161
|
// Only clear the height when the content shortens to minimize scrollbar flickering.
|
|
165
162
|
const valueLength = this.value ? this.value.length : 0;
|
|
@@ -184,7 +181,14 @@ export const TextAreaMixin = (superClass) =>
|
|
|
184
181
|
this._oldValueLength = valueLength;
|
|
185
182
|
|
|
186
183
|
const inputHeight = input.scrollHeight;
|
|
187
|
-
|
|
184
|
+
// Snap to the previous explicit height when the new measurement is
|
|
185
|
+
// within 1 CSS pixel of it. The pin/unpin cycle produces a 1 px
|
|
186
|
+
// asymmetry on low-DPR displays that would otherwise oscillate
|
|
187
|
+
// visibly on every keystroke; real content changes always move
|
|
188
|
+
// scrollHeight by at least one line.
|
|
189
|
+
if (Math.abs(inputHeight - previousExplicitHeight) <= 1) {
|
|
190
|
+
input.style.height = `${previousExplicitHeight}px`;
|
|
191
|
+
} else if (inputHeight > input.clientHeight) {
|
|
188
192
|
input.style.height = `${inputHeight}px`;
|
|
189
193
|
}
|
|
190
194
|
|
package/src/vaadin-text-area.js
CHANGED
|
@@ -85,9 +85,6 @@ import { TextAreaMixin } from './vaadin-text-area-mixin.js';
|
|
|
85
85
|
*
|
|
86
86
|
* @customElement vaadin-text-area
|
|
87
87
|
* @extends HTMLElement
|
|
88
|
-
* @mixes ElementMixin
|
|
89
|
-
* @mixes TextAreaMixin
|
|
90
|
-
* @mixes ThemableMixin
|
|
91
88
|
*/
|
|
92
89
|
export class TextArea extends TextAreaMixin(ThemableMixin(ElementMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
|
|
93
90
|
static get is() {
|
package/web-types.json
CHANGED
package/web-types.lit.json
CHANGED