Skip to content

Commit 81dd1cc

Browse files
committed
fix(tabs): remove tabbarIcons and fix windows styling to use tabbarLayout
update tabs docs. BREAKING CHANGE: `tabbarIcons` is officially removed, please use `tabbarLayout` instead. View the Tabs API docs for more information. fixes #6126 references #5819
1 parent 5d08a5d commit 81dd1cc

File tree

3 files changed

+13
-20
lines changed

3 files changed

+13
-20
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,9 @@ Windows platform support has been added to Ionic! The Windows mode is abbreviate
361361

362362
### Refactor
363363

364-
* **alert:** remove tabbarIcons and add tabbarLayout which accepts different values ([8cfebe1](https://github.com/driftyco/ionic/commit/8cfebe1)), closes [#5625](https://github.com/driftyco/ionic/issues/5625)
365364
* **menu:** improve menu get lookup ([004e635](https://github.com/driftyco/ionic/commit/004e635)), closes [#5535](https://github.com/driftyco/ionic/issues/5535)
366365
* **tabs:** remove duplicated styles from imports ([d5ebf3f](https://github.com/driftyco/ionic/commit/d5ebf3f)), closes [#5624](https://github.com/driftyco/ionic/issues/5624)
366+
* **tabs:** remove tabbarIcons and add tabbarLayout which accepts different values ([8cfebe1](https://github.com/driftyco/ionic/commit/8cfebe1)), closes [#5625](https://github.com/driftyco/ionic/issues/5625)
367367
* **searchbar:** add class to searchbar when hideCancel is passed ([a0f0004](https://github.com/driftyco/ionic/commit/a0f0004))
368368

369369
### Breaking Changes

ionic/components/tabs/tabs.ts

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ import {isBlank, isTrueProperty} from '../../util/util';
2525
* ### Placement
2626
*
2727
* The position of the tabs relative to the content varies based on
28-
* the mode. By default the tabs are placed at the bottom of the screen
29-
* in `ios` mode, and at the top for `wp` and `md` mode. You can
28+
* the mode. By default, the tabs are placed at the bottom of the screen
29+
* for `ios` mode, and at the top for the `md` and `wp` modes. You can
3030
* configure the position using the `tabbarPlacement` property on the
3131
* `<ion-tabs>` element, or in your app's [config](../../config/Config/).
3232
* See the [Input Properties](#input-properties) below for the available
@@ -36,7 +36,7 @@ import {isBlank, isTrueProperty} from '../../util/util';
3636
*
3737
* The layout for all of the tabs can be defined using the `tabbarLayout`
3838
* property. If the individual tab has a title and icon, the icons will
39-
* show on top of the title in a tab. All tabs can be changed by setting
39+
* show on top of the title by default. All tabs can be changed by setting
4040
* the value of `tabbarLayout` on the `<ion-tabs>` element, or in your
4141
* app's [config](../../config/Config/). For example, this is useful if
4242
* you want to show tabs with a title only on Android, but show icons
@@ -60,7 +60,7 @@ import {isBlank, isTrueProperty} from '../../util/util';
6060
* Since the index starts at `0`, this will select the 3rd tab which has
6161
* root set to `tab3Root`. You can also grab the `Tabs` instance and call
6262
* the `select()` method. This requires the `<ion-tabs>` element to have
63-
* an `id`. For example, set the `id` to `myTabs`:
63+
* an `id`. For example, set the value of `id` to `myTabs`:
6464
*
6565
* ```html
6666
* <ion-tabs id="myTabs">
@@ -70,8 +70,9 @@ import {isBlank, isTrueProperty} from '../../util/util';
7070
* </ion-tabs>
7171
* ```
7272
*
73-
* Then in your JavaScript you can grab the `Tabs` instance and call `select()`.
74-
* In the following code `app` is of type [`IonicApp`](../../app/IonicApp/):
73+
* Then in your JavaScript you can grab the `Tabs` instance and call `select()`,
74+
* passing the index of the tab as the argument. In the following code `app` is
75+
* of type [`IonicApp`](../../app/IonicApp/):
7576
*
7677
*```js
7778
* constructor(app: IonicApp) {
@@ -163,11 +164,6 @@ export class Tabs extends Ion {
163164
*/
164165
@Input() preloadTabs: any;
165166

166-
/**
167-
* @input {string} Deprecated, use `tabbarLayout` instead. Set the position of the tabbar's icons: `top`, `bottom`, `left`, `right`, `hide`.
168-
*/
169-
@Input() tabbarIcons: string;
170-
171167
/**
172168
* @input {string} Set the tabbar layout: `icon-top`, `icon-left`, `icon-right`, `icon-bottom`, `icon-hide`, `title-hide`.
173169
*/
@@ -241,11 +237,6 @@ export class Tabs extends Ion {
241237
ngAfterViewInit() {
242238
this._setConfig('tabbarPlacement', 'bottom');
243239
this._setConfig('tabbarLayout', 'icon-top');
244-
this._setConfig('tabbarIcons', 'top');
245-
246-
if (this.tabbarIcons) {
247-
console.warn('DEPRECATION WARNING: "tabbarIcons" is no longer supported and will be removed in next major release. Use "tabbarLayout" instead. Available values: "icon-top", "icon-left", "icon-right", "icon-bottom", "icon-hide", "title-hide".');
248-
}
249240

250241
if (this._useHighlight) {
251242
this._platform.onResize(() => {

ionic/components/tabs/tabs.wp.scss

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,22 @@ tabbar {
5656
font-size: $tabbar-wp-item-icon-size;
5757
}
5858

59-
[tabbarIcons=bottom] .tab-button {
59+
[tabbarLayout=icon-bottom] .tab-button {
6060
padding-top: 8px;
6161
padding-bottom: 8px;
6262
}
6363

64-
[tabbarIcons=right] .tab-button,
65-
[tabbarIcons=left] .tab-button {
64+
[tabbarLayout=icon-right] .tab-button,
65+
[tabbarLayout=icon-left] .tab-button {
6666
padding-bottom: 10px;
6767

6868
ion-icon {
6969
min-width: 24px;
7070
}
7171
}
7272

73+
[tabbarLayout=icon-hide] .tab-button,
74+
[tabbarLayout=title-hide] .tab-button,
7375
.tab-button.icon-only,
7476
.tab-button.has-title-only {
7577
padding: 6px 10px;

0 commit comments

Comments
 (0)