Browse Source

fix(columns_area): Manually set tabs style when swiping (#4320)

pull/4/head
Sorin Davidoi 6 years ago
committed by Eugen Rochko
parent
commit
a248be4fce
1 changed files with 9 additions and 0 deletions
  1. +9
    -0
      app/javascript/mastodon/features/ui/components/columns_area.js

+ 9
- 0
app/javascript/mastodon/features/ui/components/columns_area.js View File

@ -56,6 +56,15 @@ export default class ColumnsArea extends ImmutablePureComponent {
handleSwipe = (index) => {
this.pendingIndex = index;
const nextLinkTranslationId = links[index].props['data-preview-title-id'];
const currentLinkSelector = '.tabs-bar__link.active';
const nextLinkSelector = `.tabs-bar__link[data-preview-title-id="${nextLinkTranslationId}"]`;
// HACK: Remove the active class from the current link and set it to the next one
// React-router does this for us, but too late, feeling laggy.
document.querySelector(currentLinkSelector).classList.remove('active');
document.querySelector(nextLinkSelector).classList.add('active');
}
handleAnimationEnd = () => {

Loading…
Cancel
Save