mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-17 02:31:34 +08:00
fix(accesibility): boolean aria-* properties
This commit is contained in:
@ -313,7 +313,15 @@ export class Alert implements OverlayInterface {
|
|||||||
return (
|
return (
|
||||||
<div class="alert-checkbox-group" aria-labelledby={labelledby}>
|
<div class="alert-checkbox-group" aria-labelledby={labelledby}>
|
||||||
{ inputs.map((i) => (
|
{ inputs.map((i) => (
|
||||||
<button onClick={() => this.cbClick(i)} aria-checked={i.checked} id={i.id} disabled={i.disabled} tabIndex={0} role="checkbox" class="alert-tappable alert-checkbox alert-checkbox-button">
|
<button
|
||||||
|
onClick={() => this.cbClick(i)}
|
||||||
|
aria-checked={i.checked ? 'true' : null}
|
||||||
|
id={i.id}
|
||||||
|
disabled={i.disabled}
|
||||||
|
tabIndex={0}
|
||||||
|
role="checkbox"
|
||||||
|
class="alert-tappable alert-checkbox alert-checkbox-button">
|
||||||
|
|
||||||
<div class="alert-button-inner">
|
<div class="alert-button-inner">
|
||||||
<div class="alert-checkbox-icon"><div class="alert-checkbox-inner"></div></div>
|
<div class="alert-checkbox-icon"><div class="alert-checkbox-inner"></div></div>
|
||||||
<div class="alert-checkbox-label">
|
<div class="alert-checkbox-label">
|
||||||
@ -335,7 +343,13 @@ export class Alert implements OverlayInterface {
|
|||||||
return (
|
return (
|
||||||
<div class="alert-radio-group" role="radiogroup" aria-labelledby={labelledby} aria-activedescendant={this.activeId}>
|
<div class="alert-radio-group" role="radiogroup" aria-labelledby={labelledby} aria-activedescendant={this.activeId}>
|
||||||
{ inputs.map((i) => (
|
{ inputs.map((i) => (
|
||||||
<button onClick={() => this.rbClick(i)} aria-checked={i.checked} disabled={i.disabled} id={i.id} tabIndex={0} class="alert-radio-button alert-tappable alert-radio" role="radio">
|
<button
|
||||||
|
onClick={() => this.rbClick(i)}
|
||||||
|
aria-checked={i.checked ? 'true' : null}
|
||||||
|
disabled={i.disabled}
|
||||||
|
id={i.id} tabIndex={0}
|
||||||
|
class="alert-radio-button alert-tappable alert-radio"
|
||||||
|
role="radio">
|
||||||
<div class="alert-button-inner">
|
<div class="alert-button-inner">
|
||||||
<div class="alert-radio-icon"><div class="alert-radio-inner"></div></div>
|
<div class="alert-radio-icon"><div class="alert-radio-inner"></div></div>
|
||||||
<div class="alert-radio-label">
|
<div class="alert-radio-label">
|
||||||
|
@ -577,7 +577,7 @@ export class Datetime {
|
|||||||
aria-haspopup="true"
|
aria-haspopup="true"
|
||||||
id={this.datetimeId}
|
id={this.datetimeId}
|
||||||
aria-labelledby={this.labelId}
|
aria-labelledby={this.labelId}
|
||||||
aria-disabled={this.disabled ? 'true' : false}
|
aria-disabled={this.disabled ? 'true' : null}
|
||||||
onClick={this.open.bind(this)}
|
onClick={this.open.bind(this)}
|
||||||
class="datetime-cover">
|
class="datetime-cover">
|
||||||
{ this.mode === 'md' && <ion-ripple-effect tapClick={true}/> }
|
{ this.mode === 'md' && <ion-ripple-effect tapClick={true}/> }
|
||||||
|
@ -319,7 +319,7 @@ export class Input implements InputComponent {
|
|||||||
return [
|
return [
|
||||||
<input
|
<input
|
||||||
ref={input => this.nativeInput = input as any}
|
ref={input => this.nativeInput = input as any}
|
||||||
aria-disabled={this.disabled ? 'true' : false}
|
aria-disabled={this.disabled ? 'true' : null}
|
||||||
accept={this.accept}
|
accept={this.accept}
|
||||||
autoCapitalize={this.autocapitalize}
|
autoCapitalize={this.autocapitalize}
|
||||||
autoComplete={this.autocomplete}
|
autoComplete={this.autocomplete}
|
||||||
|
@ -52,7 +52,7 @@ export class RangeKnob {
|
|||||||
'tabindex': this.disabled ? -1 : 0,
|
'tabindex': this.disabled ? -1 : 0,
|
||||||
'aria-valuemin': min,
|
'aria-valuemin': min,
|
||||||
'aria-valuemax': max,
|
'aria-valuemax': max,
|
||||||
'aria-disabled': this.disabled,
|
'aria-disabled': this.disabled ? 'true' : null,
|
||||||
'aria-labelledby': this.labelId,
|
'aria-labelledby': this.labelId,
|
||||||
'aria-valuenow': value
|
'aria-valuenow': value
|
||||||
};
|
};
|
||||||
|
@ -68,7 +68,7 @@ export class SegmentButton {
|
|||||||
render() {
|
render() {
|
||||||
return [
|
return [
|
||||||
<button
|
<button
|
||||||
aria-pressed={this.checked}
|
aria-pressed={this.checked ? 'true' : null}
|
||||||
class="segment-button-native"
|
class="segment-button-native"
|
||||||
disabled={this.disabled}
|
disabled={this.disabled}
|
||||||
onClick={() => this.checked = true }>
|
onClick={() => this.checked = true }>
|
||||||
|
@ -487,9 +487,9 @@ export class Select {
|
|||||||
type="button"
|
type="button"
|
||||||
role="combobox"
|
role="combobox"
|
||||||
aria-haspopup="dialog"
|
aria-haspopup="dialog"
|
||||||
aria-expanded={this.isExpanded}
|
|
||||||
aria-labelledby={this.labelId}
|
aria-labelledby={this.labelId}
|
||||||
aria-disabled={this.disabled ? 'true' : false}
|
aria-expanded={this.isExpanded ? 'true' : null}
|
||||||
|
aria-disabled={this.disabled ? 'true' : null}
|
||||||
onClick={this.open.bind(this)}
|
onClick={this.open.bind(this)}
|
||||||
onKeyUp={this.onKeyUp.bind(this)}
|
onKeyUp={this.onKeyUp.bind(this)}
|
||||||
onFocus={this.onFocus.bind(this)}
|
onFocus={this.onFocus.bind(this)}
|
||||||
|
@ -48,7 +48,7 @@ export class TabButton {
|
|||||||
const hasBadge = !!this.badge;
|
const hasBadge = !!this.badge;
|
||||||
return {
|
return {
|
||||||
'role': 'tab',
|
'role': 'tab',
|
||||||
'aria-selected': selected,
|
'aria-selected': selected ? 'true' : null,
|
||||||
class: {
|
class: {
|
||||||
...createColorClasses(this.color),
|
...createColorClasses(this.color),
|
||||||
'tab-selected': selected,
|
'tab-selected': selected,
|
||||||
|
Reference in New Issue
Block a user