@fluid-topics/ft-radio 1.3.42 → 1.3.44

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.
@@ -4,14 +4,12 @@ import { FtBaseRadio } from "./ft-radio";
4
4
  export interface FtBaseRadioGroupProperties {
5
5
  name?: string;
6
6
  role?: string;
7
- tabIndex?: number;
8
7
  ariaLabelledBy?: string;
9
8
  }
10
9
  export declare class FtBaseRadioGroup extends FtLitElement implements FtBaseRadioGroupProperties {
11
10
  static elementDefinitions: {};
12
11
  name: string;
13
12
  role: string;
14
- tabIndex: number;
15
13
  ariaLabelledBy: string;
16
14
  assignedElements?: Array<Element>;
17
15
  get radioButtons(): Array<FtBaseRadio>;
@@ -12,20 +12,12 @@ class FtBaseRadioGroup extends FtLitElement {
12
12
  super(...arguments);
13
13
  this.name = "";
14
14
  this.role = "radiogroup";
15
- this.tabIndex = 0;
16
15
  this.ariaLabelledBy = "";
17
16
  this.currentSelectedIndex = 0;
18
17
  this.onFocus = () => {
19
- if (this.tabIndex == 0) {
20
- this.tabIndex = -1;
21
- setTimeout(() => this.focusCurrentChecked(), 100);
22
- }
18
+ setTimeout(() => this.focusCurrentChecked(), 100);
23
19
  };
24
20
  this.onFocusOut = (e) => {
25
- const nextFocusOutsideOfGroup = !this.contains(e.relatedTarget);
26
- if (nextFocusOutsideOfGroup) {
27
- this.tabIndex = 0;
28
- }
29
21
  };
30
22
  }
31
23
  get radioButtons() {
@@ -103,6 +95,7 @@ class FtBaseRadioGroup extends FtLitElement {
103
95
  else {
104
96
  this.currentSelectedIndex = checkedButtonIndex;
105
97
  }
98
+ this.radioButtons[this.currentSelectedIndex].setInputTabIndex(0);
106
99
  }
107
100
  focusCurrentChecked() {
108
101
  this.radioButtons[this.currentSelectedIndex].focus();
@@ -115,9 +108,6 @@ __decorate([
115
108
  __decorate([
116
109
  property({ reflect: true, attribute: "role" })
117
110
  ], FtBaseRadioGroup.prototype, "role", void 0);
118
- __decorate([
119
- property({ reflect: true })
120
- ], FtBaseRadioGroup.prototype, "tabIndex", void 0);
121
111
  __decorate([
122
112
  property({ reflect: true, attribute: "aria-labelledby" })
123
113
  ], FtBaseRadioGroup.prototype, "ariaLabelledBy", void 0);
@@ -35,7 +35,7 @@ class FtBaseRadio extends FtLitElement {
35
35
  return "";
36
36
  }
37
37
  render() {
38
- // We use aria-hidden on the input to prevent the "radio" role to be present twice in the aria tree
38
+ // We use inert on the input to prevent the "radio" role to be present twice in the aria tree
39
39
  return html `
40
40
  <div class="${classMap(this.radioClasses)}"
41
41
  @click=${this.onClick}>
@@ -54,9 +54,9 @@ class FtBaseRadio extends FtLitElement {
54
54
  .checked=${this.checked}
55
55
  .disabled=${this.disabled}
56
56
  @change=${this.onChange}
57
- aria-hidden="true">
57
+ >
58
58
  </div>
59
- <label for="radio-button">
59
+ <label for="radio-button" inert >
60
60
  <ft-typography variant="${this.typographyVariant}">
61
61
  <slot></slot>
62
62
  </ft-typography>