Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tab-button): fix focus when tabbing into tab button #17502

Merged
merged 50 commits into from
May 14, 2019
Merged
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
de43e18
fix(tab-button): fix focus when tabbing into tab button
liamdebeasi Feb 14, 2019
bcd4b24
update var name
liamdebeasi Feb 14, 2019
be2f729
Merge branch 'master' into tab-button-focus
liamdebeasi Feb 19, 2019
8c28d76
switch from fake href to tabindex
liamdebeasi Feb 19, 2019
08b76b6
fix clean build
liamdebeasi Feb 19, 2019
e9c90d5
Merge branch 'tab-button-focus' of https://github.com/ionic-team/ioni…
liamdebeasi Feb 19, 2019
081bcfa
fix tab scenariors
liamdebeasi Feb 20, 2019
d206e67
remove old code
liamdebeasi Feb 20, 2019
9c038ce
remove more old code
liamdebeasi Feb 20, 2019
f378b3b
Merge branch 'master' into tab-button-focus
liamdebeasi Feb 20, 2019
00230ce
Merge branch 'master' into tab-button-focus
liamdebeasi Feb 20, 2019
0ac537a
Merge branch 'master' into tab-button-focus
liamdebeasi Feb 21, 2019
fa6e4af
update component to allow tabindex override
liamdebeasi Feb 21, 2019
e4016c5
allow for custom tabindex override
liamdebeasi Feb 21, 2019
37ba087
Merge branch 'master' into tab-button-focus
liamdebeasi Feb 22, 2019
06be001
Merge branch 'master' into tab-button-focus
liamdebeasi Feb 26, 2019
5a50a75
Merge branch 'master' into tab-button-focus
liamdebeasi Mar 1, 2019
f5c4383
Merge branch 'master' into tab-button-focus
liamdebeasi Mar 1, 2019
057404b
Merge branch 'master' into tab-button-focus
liamdebeasi Mar 1, 2019
3eb9363
Merge branch 'master' into tab-button-focus
liamdebeasi Mar 4, 2019
c096863
Merge branch 'master' into tab-button-focus
liamdebeasi Mar 4, 2019
c79e8ec
Merge branch 'master' into tab-button-focus
liamdebeasi Mar 15, 2019
4a25665
Merge branch 'tab-button-focus' of https://github.com/ionic-team/ioni…
liamdebeasi Mar 19, 2019
4c47b3e
fix(): tabindex should not be set for disabled buttons
liamdebeasi Mar 19, 2019
eaa1b3b
add tab active test wait
liamdebeasi Mar 19, 2019
edb6ce4
remove :not
liamdebeasi Mar 19, 2019
0d94813
Revert "fix(popover): update animation origin in RTL/MD (#17645)"
liamdebeasi Mar 19, 2019
84c27ef
Revert "fix(spinner): fix default spinner logic for relevant componen…
liamdebeasi Mar 19, 2019
b89c282
Revert "docs(tabs): correct ion-route property `path` to `url` (#17794)"
liamdebeasi Mar 19, 2019
060f24d
Revert "fix(toggle): do not use the contrast color for toggle inner c…
liamdebeasi Mar 19, 2019
da305e0
change timeout to waitForVisible
liamdebeasi Mar 19, 2019
f83dfef
Merge branch 'master' into tab-button-focus
liamdebeasi Mar 19, 2019
6a97f21
Revert "Revert "fix(toggle): do not use the contrast color for toggle…
liamdebeasi Mar 19, 2019
1901bec
Revert "Revert "docs(tabs): correct ion-route property `path` to `url…
liamdebeasi Mar 19, 2019
9e44a38
Revert "Revert "fix(spinner): fix default spinner logic for relevant …
liamdebeasi Mar 19, 2019
7417cbe
Revert "Revert "fix(popover): update animation origin in RTL/MD (#176…
liamdebeasi Mar 19, 2019
b1b9c25
Merge branch 'master' into tab-button-focus
liamdebeasi Mar 26, 2019
98ac4a8
Merge branch 'master' into tab-button-focus
liamdebeasi Mar 27, 2019
911efaf
Merge branch 'master' into tab-button-focus
liamdebeasi Mar 27, 2019
3e21657
Merge branch 'master' into tab-button-focus
liamdebeasi Mar 28, 2019
e2ccc77
Merge branch 'master' into tab-button-focus
liamdebeasi Apr 16, 2019
bc4ee26
Merge branch 'master' into tab-button-focus
brandyscarney Apr 16, 2019
5958a79
Merge branch 'master' into tab-button-focus
brandyscarney Apr 22, 2019
23f9f0b
Merge branch 'master' into tab-button-focus
brandyscarney Apr 24, 2019
8010d71
Merge branch 'master' into tab-button-focus
liamdebeasi Apr 29, 2019
da5e468
Merge branch 'master' into tab-button-focus
liamdebeasi May 10, 2019
f73363b
ensure inner element does not get tabindex
liamdebeasi May 10, 2019
1df5d55
Merge branch 'master' into tab-button-focus
brandyscarney May 10, 2019
ef8f00f
Merge branch 'master' into tab-button-focus
liamdebeasi May 14, 2019
1b89b8c
Merge branch 'master' into tab-button-focus
liamdebeasi May 14, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions core/src/components/tab-bar/tab-bar.ios.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
background: #{current-color(base, $tab-bar-ios-translucent-background-color-alpha)};
}

// iOS Translucent Tab bar button
:host(.tab-bar-translucent) ::slotted(ion-tab-button) {
background: transparent;
:host(.tab-bar-translucent) ::slotted(ion-tab-button.ion-focused) {
background: rgba($background-color-rgb, .6);
}
4 changes: 0 additions & 4 deletions core/src/components/tab-bar/tab-bar.md.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,4 @@
--color-selected: #{$tabbar-md-color-activated};

height: 56px;
}

:host(.tab-bar-translucent) ::slotted(ion-tab-button) {
background: transparent;
}
25 changes: 19 additions & 6 deletions core/src/components/tab-bar/tab-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,32 @@
box-sizing: content-box !important;
}

:host(.ion-color) ::slotted(ion-tab-button) {
--background-focused: #{current-color(shade)};
--color-selected: #{current-color(contrast)};
}

:host(.ion-color) ::slotted(.tab-selected) {
color: #{current-color(contrast)};;
}

:host(.ion-color),
:host(.ion-color) ::slotted(ion-tab-button) {
background: #{current-color(base)};
color: #{current-color(contrast, .7)};
}

:host(.ion-color),
:host(.ion-color) ::slotted(ion-tab-button) {
--background-focused: #{current-color(shade)};
--color-selected: #{current-color(contrast)};
background: #{current-color(base)};
}

:host(.ion-color) ::slotted(.tab-selected) {
color: #{current-color(contrast)};;
:host(.ion-color) ::slotted(ion-tab-button.ion-focused),
:host(.tab-bar-translucent) ::slotted(ion-tab-button.ion-focused) {
background: var(--background-focused)
}

:host(.tab-bar-translucent) ::slotted(ion-tab-button) {
background: transparent;
}

:host([slot="top"]) {
Expand All @@ -58,4 +71,4 @@
:host(.tab-bar-hidden) {
/* stylelint-disable-next-line declaration-no-important */
display: none !important;
}
}
16 changes: 14 additions & 2 deletions core/src/components/tab-bar/test/custom/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ test('tab-bar: custom', async () => {
url: '/src/components/tab-bar/test/custom?ionic:_testing=true'
});

const compare = await page.compareScreenshot();
expect(compare).toMatchScreenshot();
const screenshotCompares = [];

const tabBar = await page.find('ion-tab-bar');
await tabBar.waitForVisible();

screenshotCompares.push(await page.compareScreenshot('tab-bar: custom default'));

await page.keyboard.press('Tab');

screenshotCompares.push(await page.compareScreenshot('tab-bar: custom tabbed'));
await page.waitFor(10000);
for (const screenshotCompare of screenshotCompares) {
expect(screenshotCompare).toMatchScreenshot();
}
});
6 changes: 6 additions & 0 deletions core/src/components/tab-bar/test/custom/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
<ion-content>
<!-- Default -->
<ion-tab-bar selected-tab="1">

<ion-tab-button tab="1" disabled>
<ion-icon name="clock"></ion-icon>
<ion-label>Recents</ion-label>
</ion-tab-button>

<ion-tab-button tab="1">
<ion-icon name="clock"></ion-icon>
<ion-label>Recents</ion-label>
Expand Down
Loading