mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-17 18:54:11 +08:00
fix(checkbox, radio): label is announced once on ios (#26770)
resolves #26769
This commit is contained in:
@ -247,6 +247,21 @@ export class Checkbox implements ComponentInterface {
|
|||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<label class="checkbox-wrapper">
|
<label class="checkbox-wrapper">
|
||||||
|
{/*
|
||||||
|
The native control must be rendered
|
||||||
|
before the visible label text due to https://bugs.webkit.org/show_bug.cgi?id=251951
|
||||||
|
*/}
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
aria-checked={`${checked}`}
|
||||||
|
disabled={disabled}
|
||||||
|
id={inputId}
|
||||||
|
onChange={this.toggleChecked}
|
||||||
|
onFocus={() => this.onFocus()}
|
||||||
|
onBlur={() => this.onBlur()}
|
||||||
|
ref={(focusEl) => (this.focusEl = focusEl)}
|
||||||
|
{...inheritedAttributes}
|
||||||
|
/>
|
||||||
<div
|
<div
|
||||||
class={{
|
class={{
|
||||||
'label-text-wrapper': true,
|
'label-text-wrapper': true,
|
||||||
@ -260,17 +275,6 @@ export class Checkbox implements ComponentInterface {
|
|||||||
{path}
|
{path}
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
<input
|
|
||||||
type="checkbox"
|
|
||||||
aria-checked={`${checked}`}
|
|
||||||
disabled={disabled}
|
|
||||||
id={inputId}
|
|
||||||
onChange={this.toggleChecked}
|
|
||||||
onFocus={() => this.onFocus()}
|
|
||||||
onBlur={() => this.onBlur()}
|
|
||||||
ref={(focusEl) => (this.focusEl = focusEl)}
|
|
||||||
{...inheritedAttributes}
|
|
||||||
/>
|
|
||||||
</label>
|
</label>
|
||||||
</Host>
|
</Host>
|
||||||
);
|
);
|
||||||
|
@ -234,6 +234,18 @@ export class Radio implements ComponentInterface {
|
|||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<label class="radio-wrapper">
|
<label class="radio-wrapper">
|
||||||
|
{/*
|
||||||
|
The native control must be rendered
|
||||||
|
before the visible label text due to https://bugs.webkit.org/show_bug.cgi?id=251951
|
||||||
|
*/}
|
||||||
|
<input
|
||||||
|
type="radio"
|
||||||
|
checked={checked}
|
||||||
|
disabled={disabled}
|
||||||
|
id={inputId}
|
||||||
|
ref={(nativeEl) => (this.nativeInput = nativeEl as HTMLInputElement)}
|
||||||
|
{...inheritedAttributes}
|
||||||
|
/>
|
||||||
<div
|
<div
|
||||||
class={{
|
class={{
|
||||||
'label-text-wrapper': true,
|
'label-text-wrapper': true,
|
||||||
@ -243,14 +255,6 @@ export class Radio implements ComponentInterface {
|
|||||||
<slot></slot>
|
<slot></slot>
|
||||||
</div>
|
</div>
|
||||||
<div class="native-wrapper">{this.renderRadioControl()}</div>
|
<div class="native-wrapper">{this.renderRadioControl()}</div>
|
||||||
<input
|
|
||||||
type="radio"
|
|
||||||
checked={checked}
|
|
||||||
disabled={disabled}
|
|
||||||
id={inputId}
|
|
||||||
ref={(nativeEl) => (this.nativeInput = nativeEl as HTMLInputElement)}
|
|
||||||
{...inheritedAttributes}
|
|
||||||
/>
|
|
||||||
</label>
|
</label>
|
||||||
</Host>
|
</Host>
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user