From eb9ed179dad1b8ff8b0017225d29ebd43d2ec3d6 Mon Sep 17 00:00:00 2001 From: Brandy Carney Date: Thu, 12 Jul 2018 10:28:12 -0400 Subject: [PATCH] fix(tab-button): add a class to hide the tab when show is false --- core/src/components/tab-button/tab-button.scss | 7 ++++++- core/src/components/tab-button/tab-button.tsx | 2 +- core/src/components/tabs/test/basic/index.html | 15 ++++++++++----- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/core/src/components/tab-button/tab-button.scss b/core/src/components/tab-button/tab-button.scss index d267330e4df..727e6d53b19 100644 --- a/core/src/components/tab-button/tab-button.scss +++ b/core/src/components/tab-button/tab-button.scss @@ -1,9 +1,10 @@ @import "../../themes/ionic.globals"; :host { + @include border-radius(0); @include margin(0); + text-align: center; - @include border-radius(0); box-sizing: border-box; @@ -42,6 +43,10 @@ color: var(--color-selected); } +:host(.tab-hidden) { + display: none; +} + a { text-decoration: none; } diff --git a/core/src/components/tab-button/tab-button.tsx b/core/src/components/tab-button/tab-button.tsx index 3531ad225b3..378e950d8ae 100644 --- a/core/src/components/tab-button/tab-button.tsx +++ b/core/src/components/tab-button/tab-button.tsx @@ -74,9 +74,9 @@ export class TabButton { 'role': 'tab', 'id': tab.btnId, 'aria-selected': selected, - 'hidden': !tab.show, class: { ...createColorClasses(this.color), + 'tab-hidden': !tab.show, 'tab-selected': selected, 'has-label': hasLabel, 'has-icon': hasIcon, diff --git a/core/src/components/tabs/test/basic/index.html b/core/src/components/tabs/test/basic/index.html index d2a7178a071..d3ef8e4af5a 100644 --- a/core/src/components/tabs/test/basic/index.html +++ b/core/src/components/tabs/test/basic/index.html @@ -14,7 +14,6 @@ - Tab One @@ -23,11 +22,9 @@ Tab One - - Tab Two @@ -36,11 +33,9 @@ Tab Two - - Tab Three @@ -49,7 +44,17 @@ Tab Three + + + + + Hidden Tab + + + + Hidden Tab +