@vaadin/vaadin-text-field 2.9.0 → 2.9.1
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 +8 -7
- package/src/vaadin-email-field.js +1 -1
- package/src/vaadin-integer-field.js +1 -1
- package/src/vaadin-number-field.js +1 -1
- package/src/vaadin-password-field.js +1 -1
- package/src/vaadin-text-area.js +21 -2
- package/src/vaadin-text-field.js +1 -1
- package/theme/material/vaadin-text-area-styles.js +5 -0
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"repository": "vaadin/vaadin-text-field",
|
|
11
11
|
"homepage": "https://vaadin.com/components",
|
|
12
12
|
"name": "@vaadin/vaadin-text-field",
|
|
13
|
-
"version": "2.9.
|
|
13
|
+
"version": "2.9.1",
|
|
14
14
|
"main": "vaadin-text-field.js",
|
|
15
15
|
"author": "Vaadin Ltd",
|
|
16
16
|
"license": "Apache-2.0",
|
|
@@ -25,8 +25,6 @@
|
|
|
25
25
|
"theme"
|
|
26
26
|
],
|
|
27
27
|
"resolutions": {
|
|
28
|
-
"es-abstract": "1.17.6",
|
|
29
|
-
"@types/doctrine": "0.0.3",
|
|
30
28
|
"inherits": "2.0.3",
|
|
31
29
|
"samsam": "1.1.3",
|
|
32
30
|
"supports-color": "3.1.2",
|
|
@@ -40,10 +38,9 @@
|
|
|
40
38
|
"@vaadin/vaadin-material-styles": "^1.3.2",
|
|
41
39
|
"@vaadin/vaadin-element-mixin": "^2.4.1"
|
|
42
40
|
},
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"devDependencies": {
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@web-padawan/gen-typescript-declarations": "^1.6.2",
|
|
43
|
+
"web-component-tester": "6.9.2",
|
|
47
44
|
"@polymer/iron-component-page": "^4.0.0",
|
|
48
45
|
"@polymer/iron-form": "^3.0.0",
|
|
49
46
|
"@polymer/iron-test-helpers": "^3.0.0",
|
|
@@ -51,5 +48,9 @@
|
|
|
51
48
|
"wct-browser-legacy": "^1.0.1",
|
|
52
49
|
"@vaadin/vaadin-demo-helpers": "^3.0.0",
|
|
53
50
|
"@vaadin/vaadin-button": "^2.1.0"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"generate-typings": "gen-typescript-declarations --outDir . --verify",
|
|
54
|
+
"test": "wct --npm"
|
|
54
55
|
}
|
|
55
56
|
}
|
package/src/vaadin-text-area.js
CHANGED
|
@@ -121,7 +121,7 @@ class TextAreaElement extends
|
|
|
121
121
|
|
|
122
122
|
<label part="label" on-click="focus" id="[[_labelId]]">[[label]]</label>
|
|
123
123
|
|
|
124
|
-
<div part="input-field" id="[[_inputId]]">
|
|
124
|
+
<div part="input-field" id="[[_inputId]]" on-scroll="__scrollPositionUpdated">
|
|
125
125
|
|
|
126
126
|
<slot name="prefix"></slot>
|
|
127
127
|
|
|
@@ -149,7 +149,7 @@ class TextAreaElement extends
|
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
static get version() {
|
|
152
|
-
return '2.9.
|
|
152
|
+
return '2.9.1';
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
static get properties() {
|
|
@@ -175,6 +175,25 @@ class TextAreaElement extends
|
|
|
175
175
|
super.ready();
|
|
176
176
|
this._updateHeight();
|
|
177
177
|
this.addEventListener('animationend', this._onAnimationEnd);
|
|
178
|
+
|
|
179
|
+
this._inputField = this.root.querySelector('[part=input-field]');
|
|
180
|
+
// Wheel scrolling results in async scroll events. Preventing the wheel
|
|
181
|
+
// event, scrolling manually and then synchronously updating the scroll position CSS variable
|
|
182
|
+
// allows us to avoid some jumpy behavior that would occur on wheel otherwise.
|
|
183
|
+
this._inputField.addEventListener('wheel', (e) => {
|
|
184
|
+
e.preventDefault();
|
|
185
|
+
this._inputField.scrollTop += e.deltaY;
|
|
186
|
+
this.__scrollPositionUpdated();
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
this.__scrollPositionUpdated();
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/** @private */
|
|
193
|
+
__scrollPositionUpdated() {
|
|
194
|
+
this.updateStyles({
|
|
195
|
+
'--_text-area-vertical-scroll-position': this._inputField.scrollTop + 'px',
|
|
196
|
+
});
|
|
178
197
|
}
|
|
179
198
|
|
|
180
199
|
/** @private */
|
package/src/vaadin-text-field.js
CHANGED
|
@@ -20,6 +20,11 @@ const $_documentContainer = html`<dom-module id="material-text-area" theme-for="
|
|
|
20
20
|
white-space: pre-wrap; /* override \`nowrap\` from <vaadin-text-field> */
|
|
21
21
|
align-self: stretch; /* override \`baseline\` from <vaadin-text-field> */
|
|
22
22
|
}
|
|
23
|
+
|
|
24
|
+
[part='input-field']::before,
|
|
25
|
+
[part='input-field']::after {
|
|
26
|
+
bottom: calc(var(--_text-area-vertical-scroll-position) * -1);
|
|
27
|
+
}
|
|
23
28
|
</style>
|
|
24
29
|
</template>
|
|
25
30
|
</dom-module>`;
|