@vaadin/field-base 24.7.0-alpha2 → 24.7.0-alpha3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/field-base",
3
- "version": "24.7.0-alpha2",
3
+ "version": "24.7.0-alpha3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -32,14 +32,14 @@
32
32
  "dependencies": {
33
33
  "@open-wc/dedupe-mixin": "^1.3.0",
34
34
  "@polymer/polymer": "^3.0.0",
35
- "@vaadin/a11y-base": "24.7.0-alpha2",
36
- "@vaadin/component-base": "24.7.0-alpha2",
35
+ "@vaadin/a11y-base": "24.7.0-alpha3",
36
+ "@vaadin/component-base": "24.7.0-alpha3",
37
37
  "lit": "^3.0.0"
38
38
  },
39
39
  "devDependencies": {
40
- "@vaadin/chai-plugins": "24.7.0-alpha2",
41
- "@vaadin/testing-helpers": "^1.0.0",
40
+ "@vaadin/chai-plugins": "24.7.0-alpha3",
41
+ "@vaadin/testing-helpers": "^1.1.0",
42
42
  "sinon": "^18.0.0"
43
43
  },
44
- "gitHead": "e2523f9b4abc5a9586fb758166f823dc40c399dd"
44
+ "gitHead": "dd5cfad6c9b54e676f5b10dffba2233775378f40"
45
45
  }
@@ -3,6 +3,7 @@
3
3
  * Copyright (c) 2021 - 2024 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
+ import { announce } from '@vaadin/a11y-base/src/announce.js';
6
7
  import { SlotChildObserveController } from '@vaadin/component-base/src/slot-child-observe-controller.js';
7
8
 
8
9
  /**
@@ -108,12 +109,10 @@ export class ErrorController extends SlotChildObserveController {
108
109
  errorNode.textContent = hasError ? errorMessage : '';
109
110
  errorNode.hidden = !hasError;
110
111
 
111
- // Role alert will make the error message announce immediately
112
- // as the field becomes invalid
113
112
  if (hasError) {
114
- errorNode.setAttribute('role', 'alert');
115
- } else {
116
- errorNode.removeAttribute('role');
113
+ // Assertive mode ensures VoiceOver reads
114
+ // the error message on commit with Enter.
115
+ announce(errorMessage, { mode: 'assertive' });
117
116
  }
118
117
  }
119
118
 
@@ -68,6 +68,4 @@ export declare class InputMixinClass {
68
68
  protected _toggleHasValue(hasValue: boolean): void;
69
69
 
70
70
  protected _valueChanged(value?: string, oldValue?: string): void;
71
-
72
- protected _setHasInputValue(event: InputEvent): void;
73
71
  }
@@ -206,7 +206,7 @@ export const InputMixin = dedupingMixin(
206
206
  * @private
207
207
  */
208
208
  __onInput(event) {
209
- this._setHasInputValue(event);
209
+ this._hasInputValue = !!this._inputElementValue;
210
210
  this._onInput(event);
211
211
  }
212
212
 
@@ -267,19 +267,5 @@ export const InputMixin = dedupingMixin(
267
267
  // Setting a value programmatically, sync it to input element.
268
268
  this._forwardInputValue(newVal);
269
269
  }
270
-
271
- /**
272
- * Sets the `_hasInputValue` property based on the `input` event.
273
- *
274
- * @param {InputEvent} event
275
- * @protected
276
- */
277
- _setHasInputValue(event) {
278
- // In the case a custom web component is passed as `inputElement`,
279
- // the actual native input element, on which the event occurred,
280
- // can be inside shadow trees.
281
- const target = event.composedPath()[0];
282
- this._hasInputValue = target.value.length > 0;
283
- }
284
270
  },
285
271
  );