fix(all): accesibility and global styles for hidden nodes

This commit is contained in:
Manu Mtz.-Almeida
2018-07-22 12:02:51 +02:00
parent 0ed9406e8b
commit 4b844ef1c3
17 changed files with 75 additions and 42 deletions

View File

@ -0,0 +1,4 @@
:host(.tab-hidden) {
/* stylelint-disable-next-line declaration-no-important */
display: none !important;
}

View File

@ -3,7 +3,9 @@ import { Color, ComponentRef, FrameworkDelegate } from '../../interface';
import { attachComponent } from '../../utils/framework-delegate';
@Component({
tag: 'ion-tab'
tag: 'ion-tab',
styleUrl: 'tab.scss',
shadow: true
})
export class Tab {
@ -136,13 +138,19 @@ export class Tab {
}
hostData() {
const { btnId, active, component } = this;
return {
'aria-labelledby': this.btnId,
'aria-labelledby': btnId,
'aria-hidden': !active ? 'true' : null,
'role': 'tabpanel',
'hidden': !this.active,
'class': {
'ion-page': !this.component
'ion-page': !component,
'tab-hidden': !active
}
};
}
render() {
return <slot></slot>;
}
}