mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
fix(all): accesibility and global styles for hidden nodes
This commit is contained in:
4
core/src/components/tab/tab.scss
Normal file
4
core/src/components/tab/tab.scss
Normal file
@ -0,0 +1,4 @@
|
||||
:host(.tab-hidden) {
|
||||
/* stylelint-disable-next-line declaration-no-important */
|
||||
display: none !important;
|
||||
}
|
||||
@ -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>;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user