Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

ui-sref does not work on md-tab when keyboard navigation is used #5819

Closed
xsegrity opened this issue Nov 18, 2015 · 2 comments
Closed

ui-sref does not work on md-tab when keyboard navigation is used #5819

xsegrity opened this issue Nov 18, 2015 · 2 comments
Assignees

Comments

@xsegrity
Copy link

Navigating via the keyboard (e.g. using arrows and then selecting tab with the spacebar) does not sync the state properly when using ui-sref with md-tab.

<md-tabs>
  <md-tab label="Tab A" ui-sref="taba" md-active="$state.is('taba')"></md-tab>
  <md-tab label="Tab B" ui-sref="tabb" md-active="$state.is('tabb')"></md-tab>
  <md-tab label="Tab C" ui-sref="tabc" md-active="$state.is('tabc')"></md-tab>
</md-tabs>

Changing this line of code in the keydown function seems to fix the problem but I am not sure if it causes other issues.
(https://github.com/angular/material/blob/master/src/components/tabs/js/tabsController.js#L277)

From:

if (!locked) ctrl.selectedIndex = ctrl.focusIndex;

To:

if (!locked) select(ctrl.focusIndex);
@Splaktar
Copy link
Member

#2344 was reopened to address this.

@ThomasBurleson
Copy link
Contributor

Closing as duplicate.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants