@vaadin/field-base 24.7.0-alpha1 → 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-alpha1",
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-alpha1",
36
- "@vaadin/component-base": "24.7.0-alpha1",
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-alpha1",
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": "04be941c9a7b659871c97f31b9cc3ffd7528087b"
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
  }
@@ -32,6 +32,7 @@ export const InputMixin = dedupingMixin(
32
32
  type: Object,
33
33
  readOnly: true,
34
34
  observer: '_inputElementChanged',
35
+ sync: true,
35
36
  },
36
37
 
37
38
  /**
@@ -63,6 +64,7 @@ export const InputMixin = dedupingMixin(
63
64
  type: Boolean,
64
65
  value: false,
65
66
  observer: '_hasInputValueChanged',
67
+ sync: true,
66
68
  },
67
69
  };
68
70
  }
@@ -204,7 +206,7 @@ export const InputMixin = dedupingMixin(
204
206
  * @private
205
207
  */
206
208
  __onInput(event) {
207
- this._setHasInputValue(event);
209
+ this._hasInputValue = !!this._inputElementValue;
208
210
  this._onInput(event);
209
211
  }
210
212
 
@@ -265,19 +267,5 @@ export const InputMixin = dedupingMixin(
265
267
  // Setting a value programmatically, sync it to input element.
266
268
  this._forwardInputValue(newVal);
267
269
  }
268
-
269
- /**
270
- * Sets the `_hasInputValue` property based on the `input` event.
271
- *
272
- * @param {InputEvent} event
273
- * @protected
274
- */
275
- _setHasInputValue(event) {
276
- // In the case a custom web component is passed as `inputElement`,
277
- // the actual native input element, on which the event occurred,
278
- // can be inside shadow trees.
279
- const target = event.composedPath()[0];
280
- this._hasInputValue = target.value.length > 0;
281
- }
282
270
  },
283
271
  );
@@ -23,6 +23,7 @@ export const ValidateMixin = dedupingMixin(
23
23
  reflectToAttribute: true,
24
24
  notify: true,
25
25
  value: false,
26
+ sync: true,
26
27
  },
27
28
 
28
29
  /**
@@ -47,6 +48,7 @@ export const ValidateMixin = dedupingMixin(
47
48
  required: {
48
49
  type: Boolean,
49
50
  reflectToAttribute: true,
51
+ sync: true,
50
52
  },
51
53
  };
52
54
  }