Skip to content

Commit

Permalink
Fix the jumping of focus back to the TabList whenever one of the Movi…
Browse files Browse the repository at this point in the history
…e action buttons is clicked
  • Loading branch information
Erin Doyle committed Sep 2, 2018
1 parent a78d9cf commit a855e2e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/primitives/TabList.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,14 @@ class TabList extends Component {
this.focusTabList();
}

componentDidUpdate() {
this.focusTabList();
componentDidUpdate(prevProps) {
const { match } = this.props;

// Only when the selected tab has changed do we need to focus that TabList
// NOTE: this prevents extra focus jumping when other things change (i.e. Movie watched status)
if (prevProps.match.url !== match.url) {
this.focusTabList();
}
}

setTabListRef(element) {
Expand Down

0 comments on commit a855e2e

Please sign in to comment.