@aurodesignsystem-dev/auro-formkit 0.0.0-pr1098.1 → 0.0.0-pr1098.3

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.
@@ -16891,6 +16891,29 @@ class AuroCombobox extends AuroElement$1 {
16891
16891
  }
16892
16892
  }
16893
16893
 
16894
+ /**
16895
+ * Forces focus to the internal input element and positions the cursor at the end of the text.
16896
+ * This is used when clicking anywhere within the Combobox to ensure the input receives focus
16897
+ * and the cursor is positioned at the end for better user experience.
16898
+ * @private
16899
+ * @returns {void}
16900
+ */
16901
+ forceFocusToInputEnd() {
16902
+ // Set up input ref
16903
+ let inputElement = null;
16904
+
16905
+ if (this.input.shadowRoot) {
16906
+ inputElement = this.input.shadowRoot.querySelector('input');
16907
+ }
16908
+
16909
+ if (inputElement) {
16910
+ // Force focus and set cursor position to end of text to ensure visibility
16911
+ inputElement.focus();
16912
+ const textLength = inputElement.value ? inputElement.value.length : 0;
16913
+ inputElement.setSelectionRange(textLength, textLength);
16914
+ }
16915
+ }
16916
+
16894
16917
  /**
16895
16918
  * Binds all behavior needed to the dropdown after rendering.
16896
16919
  * @private
@@ -16919,6 +16942,9 @@ class AuroCombobox extends AuroElement$1 {
16919
16942
 
16920
16943
  this.dropdown.addEventListener('auroDropdown-triggerClick', () => {
16921
16944
  this.showBib();
16945
+
16946
+ // Fixes Chromium-specific issue where clicking outside input but within Combobox doesn't return focus
16947
+ this.forceFocusToInputEnd();
16922
16948
  });
16923
16949
 
16924
16950
  // setting up bibtemplate
@@ -16693,6 +16693,29 @@ class AuroCombobox extends AuroElement$1 {
16693
16693
  }
16694
16694
  }
16695
16695
 
16696
+ /**
16697
+ * Forces focus to the internal input element and positions the cursor at the end of the text.
16698
+ * This is used when clicking anywhere within the Combobox to ensure the input receives focus
16699
+ * and the cursor is positioned at the end for better user experience.
16700
+ * @private
16701
+ * @returns {void}
16702
+ */
16703
+ forceFocusToInputEnd() {
16704
+ // Set up input ref
16705
+ let inputElement = null;
16706
+
16707
+ if (this.input.shadowRoot) {
16708
+ inputElement = this.input.shadowRoot.querySelector('input');
16709
+ }
16710
+
16711
+ if (inputElement) {
16712
+ // Force focus and set cursor position to end of text to ensure visibility
16713
+ inputElement.focus();
16714
+ const textLength = inputElement.value ? inputElement.value.length : 0;
16715
+ inputElement.setSelectionRange(textLength, textLength);
16716
+ }
16717
+ }
16718
+
16696
16719
  /**
16697
16720
  * Binds all behavior needed to the dropdown after rendering.
16698
16721
  * @private
@@ -16721,6 +16744,9 @@ class AuroCombobox extends AuroElement$1 {
16721
16744
 
16722
16745
  this.dropdown.addEventListener('auroDropdown-triggerClick', () => {
16723
16746
  this.showBib();
16747
+
16748
+ // Fixes Chromium-specific issue where clicking outside input but within Combobox doesn't return focus
16749
+ this.forceFocusToInputEnd();
16724
16750
  });
16725
16751
 
16726
16752
  // setting up bibtemplate
@@ -376,6 +376,14 @@ export class AuroCombobox extends AuroElement {
376
376
  * @returns {void}
377
377
  */
378
378
  showBib(): void;
379
+ /**
380
+ * Forces focus to the internal input element and positions the cursor at the end of the text.
381
+ * This is used when clicking anywhere within the Combobox to ensure the input receives focus
382
+ * and the cursor is positioned at the end for better user experience.
383
+ * @private
384
+ * @returns {void}
385
+ */
386
+ private forceFocusToInputEnd;
379
387
  /**
380
388
  * Binds all behavior needed to the dropdown after rendering.
381
389
  * @private
@@ -16600,6 +16600,29 @@ class AuroCombobox extends AuroElement {
16600
16600
  }
16601
16601
  }
16602
16602
 
16603
+ /**
16604
+ * Forces focus to the internal input element and positions the cursor at the end of the text.
16605
+ * This is used when clicking anywhere within the Combobox to ensure the input receives focus
16606
+ * and the cursor is positioned at the end for better user experience.
16607
+ * @private
16608
+ * @returns {void}
16609
+ */
16610
+ forceFocusToInputEnd() {
16611
+ // Set up input ref
16612
+ let inputElement = null;
16613
+
16614
+ if (this.input.shadowRoot) {
16615
+ inputElement = this.input.shadowRoot.querySelector('input');
16616
+ }
16617
+
16618
+ if (inputElement) {
16619
+ // Force focus and set cursor position to end of text to ensure visibility
16620
+ inputElement.focus();
16621
+ const textLength = inputElement.value ? inputElement.value.length : 0;
16622
+ inputElement.setSelectionRange(textLength, textLength);
16623
+ }
16624
+ }
16625
+
16603
16626
  /**
16604
16627
  * Binds all behavior needed to the dropdown after rendering.
16605
16628
  * @private
@@ -16628,6 +16651,9 @@ class AuroCombobox extends AuroElement {
16628
16651
 
16629
16652
  this.dropdown.addEventListener('auroDropdown-triggerClick', () => {
16630
16653
  this.showBib();
16654
+
16655
+ // Fixes Chromium-specific issue where clicking outside input but within Combobox doesn't return focus
16656
+ this.forceFocusToInputEnd();
16631
16657
  });
16632
16658
 
16633
16659
  // setting up bibtemplate
@@ -16600,6 +16600,29 @@ class AuroCombobox extends AuroElement {
16600
16600
  }
16601
16601
  }
16602
16602
 
16603
+ /**
16604
+ * Forces focus to the internal input element and positions the cursor at the end of the text.
16605
+ * This is used when clicking anywhere within the Combobox to ensure the input receives focus
16606
+ * and the cursor is positioned at the end for better user experience.
16607
+ * @private
16608
+ * @returns {void}
16609
+ */
16610
+ forceFocusToInputEnd() {
16611
+ // Set up input ref
16612
+ let inputElement = null;
16613
+
16614
+ if (this.input.shadowRoot) {
16615
+ inputElement = this.input.shadowRoot.querySelector('input');
16616
+ }
16617
+
16618
+ if (inputElement) {
16619
+ // Force focus and set cursor position to end of text to ensure visibility
16620
+ inputElement.focus();
16621
+ const textLength = inputElement.value ? inputElement.value.length : 0;
16622
+ inputElement.setSelectionRange(textLength, textLength);
16623
+ }
16624
+ }
16625
+
16603
16626
  /**
16604
16627
  * Binds all behavior needed to the dropdown after rendering.
16605
16628
  * @private
@@ -16628,6 +16651,9 @@ class AuroCombobox extends AuroElement {
16628
16651
 
16629
16652
  this.dropdown.addEventListener('auroDropdown-triggerClick', () => {
16630
16653
  this.showBib();
16654
+
16655
+ // Fixes Chromium-specific issue where clicking outside input but within Combobox doesn't return focus
16656
+ this.forceFocusToInputEnd();
16631
16657
  });
16632
16658
 
16633
16659
  // setting up bibtemplate
@@ -337,10 +337,6 @@ class AuroRadio extends i$2 {
337
337
  }
338
338
 
339
339
  updated(changedProperties) {
340
- if (changedProperties.has('error') || changedProperties.has('validity')) {
341
- this.setAttribute('aria-invalid', this.error || this.validity !== 'valid' ? 'true' : 'false');
342
- }
343
-
344
340
  if (changedProperties.has('required')) {
345
341
  this.setAttribute('aria-required', this.isRequired(this.required));
346
342
  }
@@ -1713,10 +1709,14 @@ class AuroRadioGroup extends i$2 {
1713
1709
 
1714
1710
  if (changedProperties.has('validity')) {
1715
1711
  if (this.validity && this.validity !== 'valid') {
1712
+ this.setAttribute('aria-invalid', 'true');
1713
+
1716
1714
  this.items.forEach((el) => {
1717
1715
  el.setAttribute('error', true);
1718
1716
  });
1719
1717
  } else {
1718
+ this.removeAttribute('aria-invalid');
1719
+
1720
1720
  this.items.forEach((el) => {
1721
1721
  el.removeAttribute('error');
1722
1722
  });
@@ -312,10 +312,6 @@ class AuroRadio extends i$2 {
312
312
  }
313
313
 
314
314
  updated(changedProperties) {
315
- if (changedProperties.has('error') || changedProperties.has('validity')) {
316
- this.setAttribute('aria-invalid', this.error || this.validity !== 'valid' ? 'true' : 'false');
317
- }
318
-
319
315
  if (changedProperties.has('required')) {
320
316
  this.setAttribute('aria-required', this.isRequired(this.required));
321
317
  }
@@ -1688,10 +1684,14 @@ class AuroRadioGroup extends i$2 {
1688
1684
 
1689
1685
  if (changedProperties.has('validity')) {
1690
1686
  if (this.validity && this.validity !== 'valid') {
1687
+ this.setAttribute('aria-invalid', 'true');
1688
+
1691
1689
  this.items.forEach((el) => {
1692
1690
  el.setAttribute('error', true);
1693
1691
  });
1694
1692
  } else {
1693
+ this.removeAttribute('aria-invalid');
1694
+
1695
1695
  this.items.forEach((el) => {
1696
1696
  el.removeAttribute('error');
1697
1697
  });
@@ -272,10 +272,6 @@ class AuroRadio extends LitElement {
272
272
  }
273
273
 
274
274
  updated(changedProperties) {
275
- if (changedProperties.has('error') || changedProperties.has('validity')) {
276
- this.setAttribute('aria-invalid', this.error || this.validity !== 'valid' ? 'true' : 'false');
277
- }
278
-
279
275
  if (changedProperties.has('required')) {
280
276
  this.setAttribute('aria-required', this.isRequired(this.required));
281
277
  }
@@ -1641,10 +1637,14 @@ class AuroRadioGroup extends LitElement {
1641
1637
 
1642
1638
  if (changedProperties.has('validity')) {
1643
1639
  if (this.validity && this.validity !== 'valid') {
1640
+ this.setAttribute('aria-invalid', 'true');
1641
+
1644
1642
  this.items.forEach((el) => {
1645
1643
  el.setAttribute('error', true);
1646
1644
  });
1647
1645
  } else {
1646
+ this.removeAttribute('aria-invalid');
1647
+
1648
1648
  this.items.forEach((el) => {
1649
1649
  el.removeAttribute('error');
1650
1650
  });
@@ -272,10 +272,6 @@ class AuroRadio extends LitElement {
272
272
  }
273
273
 
274
274
  updated(changedProperties) {
275
- if (changedProperties.has('error') || changedProperties.has('validity')) {
276
- this.setAttribute('aria-invalid', this.error || this.validity !== 'valid' ? 'true' : 'false');
277
- }
278
-
279
275
  if (changedProperties.has('required')) {
280
276
  this.setAttribute('aria-required', this.isRequired(this.required));
281
277
  }
@@ -1641,10 +1637,14 @@ class AuroRadioGroup extends LitElement {
1641
1637
 
1642
1638
  if (changedProperties.has('validity')) {
1643
1639
  if (this.validity && this.validity !== 'valid') {
1640
+ this.setAttribute('aria-invalid', 'true');
1641
+
1644
1642
  this.items.forEach((el) => {
1645
1643
  el.setAttribute('error', true);
1646
1644
  });
1647
1645
  } else {
1646
+ this.removeAttribute('aria-invalid');
1647
+
1648
1648
  this.items.forEach((el) => {
1649
1649
  el.removeAttribute('error');
1650
1650
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aurodesignsystem-dev/auro-formkit",
3
- "version": "0.0.0-pr1098.1",
3
+ "version": "0.0.0-pr1098.3",
4
4
  "description": "A collection of web components used to build forms.",
5
5
  "homepage": "https://github.com/AlaskaAirlines/auro-formkit#readme",
6
6
  "bugs": {