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