Skip to content

Commit 3032756

Browse files
committed
refactor(checkbox, radio-group, select, toggle): update variable
1 parent 7f84e84 commit 3032756

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

core/src/components/checkbox/checkbox.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export class Checkbox implements ComponentInterface {
127127
*/
128128
@State() isInvalid = false;
129129

130-
@State() private hintTextID?: string;
130+
@State() private hintTextId?: string;
131131

132132
/**
133133
* Emitted when the checked property has changed as a result of a user action such as a click.
@@ -174,7 +174,7 @@ export class Checkbox implements ComponentInterface {
174174
* a higher priority.
175175
*/
176176
Promise.resolve().then(() => {
177-
this.hintTextID = this.getHintTextID();
177+
this.hintTextId = this.getHintTextId();
178178
});
179179
}
180180
});
@@ -194,7 +194,7 @@ export class Checkbox implements ComponentInterface {
194194
...inheritAriaAttributes(this.el),
195195
};
196196

197-
this.hintTextID = this.getHintTextID();
197+
this.hintTextId = this.getHintTextId();
198198
}
199199

200200
disconnectedCallback() {
@@ -265,7 +265,7 @@ export class Checkbox implements ComponentInterface {
265265
ev.stopPropagation();
266266
};
267267

268-
private getHintTextID(): string | undefined {
268+
private getHintTextId(): string | undefined {
269269
const { helperText, errorText, helperTextId, errorTextId, isInvalid } = this;
270270

271271
if (isInvalid && errorText) {
@@ -336,7 +336,7 @@ export class Checkbox implements ComponentInterface {
336336
<Host
337337
role="checkbox"
338338
aria-checked={indeterminate ? 'mixed' : `${checked}`}
339-
aria-describedby={this.hintTextID}
339+
aria-describedby={this.hintTextId}
340340
aria-invalid={this.isInvalid ? 'true' : undefined}
341341
aria-labelledby={hasLabelContent ? this.inputLabelId : null}
342342
aria-label={inheritedAttributes['aria-label'] || null}

core/src/components/radio-group/radio-group.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class RadioGroup implements ComponentInterface {
2929
*/
3030
@State() isInvalid = false;
3131

32-
@State() private hintTextID?: string;
32+
@State() private hintTextId?: string;
3333

3434
/**
3535
* If `true`, the radios can be deselected.
@@ -156,7 +156,7 @@ export class RadioGroup implements ComponentInterface {
156156
* a higher priority.
157157
*/
158158
Promise.resolve().then(() => {
159-
this.hintTextID = this.getHintTextID();
159+
this.hintTextId = this.getHintTextId();
160160
});
161161
}
162162
});
@@ -172,7 +172,7 @@ export class RadioGroup implements ComponentInterface {
172172
}
173173

174174
componentWillLoad() {
175-
this.hintTextID = this.getHintTextID();
175+
this.hintTextId = this.getHintTextId();
176176
}
177177

178178
disconnectedCallback() {
@@ -323,7 +323,7 @@ export class RadioGroup implements ComponentInterface {
323323
);
324324
}
325325

326-
private getHintTextID(): string | undefined {
326+
private getHintTextId(): string | undefined {
327327
const { helperText, errorText, helperTextId, errorTextId, isInvalid } = this;
328328

329329
if (isInvalid && errorText) {
@@ -347,7 +347,7 @@ export class RadioGroup implements ComponentInterface {
347347
<Host
348348
role="radiogroup"
349349
aria-labelledby={label ? labelId : null}
350-
aria-describedby={this.hintTextID}
350+
aria-describedby={this.hintTextId}
351351
aria-invalid={this.isInvalid ? 'true' : undefined}
352352
onClick={this.onClick}
353353
class={mode}

core/src/components/select/select.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export class Select implements ComponentInterface {
8787
*/
8888
@State() isInvalid = false;
8989

90-
@State() private hintTextID?: string;
90+
@State() private?: string;
9191

9292
/**
9393
* The text to display on the cancel button.
@@ -332,7 +332,7 @@ export class Select implements ComponentInterface {
332332
* a higher priority.
333333
*/
334334
Promise.resolve().then(() => {
335-
this.hintTextID = this.getHintTextID();
335+
this.hintTextId = this.getHintTextId();
336336
});
337337
}
338338
});
@@ -350,7 +350,7 @@ export class Select implements ComponentInterface {
350350
componentWillLoad() {
351351
this.inheritedAttributes = inheritAttributes(this.el, ['aria-label']);
352352

353-
this.hintTextID = this.getHintTextID();
353+
this.hintTextId = this.getHintTextId();
354354
}
355355

356356
componentDidLoad() {
@@ -1111,7 +1111,7 @@ export class Select implements ComponentInterface {
11111111
aria-label={this.ariaLabel}
11121112
aria-haspopup="dialog"
11131113
aria-expanded={`${isExpanded}`}
1114-
aria-describedby={this.hintTextID}
1114+
aria-describedby={this.hintTextId}
11151115
aria-invalid={this.isInvalid ? 'true' : undefined}
11161116
aria-required={`${required}`}
11171117
onFocus={this.onFocus}
@@ -1121,7 +1121,7 @@ export class Select implements ComponentInterface {
11211121
);
11221122
}
11231123

1124-
private getHintTextID(): string | undefined {
1124+
private getHintTextId(): string | undefined {
11251125
const { helperText, errorText, helperTextId, errorTextId, isInvalid } = this;
11261126

11271127
if (isInvalid && errorText) {

core/src/components/toggle/toggle.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export class Toggle implements ComponentInterface {
5656
*/
5757
@State() isInvalid = false;
5858

59-
@State() private hintTextID?: string;
59+
@State() private hintTextId?: string;
6060

6161
/**
6262
* The color to use from your application's color palette.
@@ -214,7 +214,7 @@ export class Toggle implements ComponentInterface {
214214
* a higher priority.
215215
*/
216216
Promise.resolve().then(() => {
217-
this.hintTextID = this.getHintTextID();
217+
this.hintTextId = this.getHintTextId();
218218
});
219219
}
220220
});
@@ -270,7 +270,7 @@ export class Toggle implements ComponentInterface {
270270
...inheritAriaAttributes(this.el),
271271
};
272272

273-
this.hintTextID = this.getHintTextID();
273+
this.hintTextId = this.getHintTextId();
274274
}
275275

276276
private onStart() {
@@ -393,7 +393,7 @@ export class Toggle implements ComponentInterface {
393393
return this.el.textContent !== '';
394394
}
395395

396-
private getHintTextID(): string | undefined {
396+
private getHintTextId(): string | undefined {
397397
const { helperText, errorText, helperTextId, errorTextId, isInvalid } = this;
398398

399399
if (isInvalid && errorText) {
@@ -462,7 +462,7 @@ export class Toggle implements ComponentInterface {
462462
<Host
463463
role="switch"
464464
aria-checked={`${checked}`}
465-
aria-describedby={this.hintTextID}
465+
aria-describedby={this.hintTextId}
466466
aria-invalid={this.isInvalid ? 'true' : undefined}
467467
onClick={this.onClick}
468468
aria-labelledby={hasLabel ? inputLabelId : null}

0 commit comments

Comments
 (0)