Skip to content

Fix duplication of features on back/forward button click - #5761

Merged
fregante merged 2 commits into
mainfrom
turbo-frame
Jul 1, 2022
Merged

fregante merged 2 commits into
mainfrom
turbo-frame

Conversation

@fregante

@fregante fregante commented Jul 1, 2022

Copy link
Copy Markdown
Member

Test

  1. Open https://github.com/refined-github/refined-github/issues
  2. Click on the "Closed" filter
  3. Go back and forth
  4. Click on the "Code" tab
  5. Go back and forth
  6. Open a folder
  7. Go back and forth

Comment thread source/features/index.tsx
await Promise.resolve();
select('#js-repo-pjax-container, #js-pjax-container')?.append(<has-rgh/>);
select('#repo-content-pjax-container')?.append(<has-rgh-inner/>); // #4567
select('#repo-content-pjax-container, turbo-frame')?.append(<has-rgh-inner/>); // #4567

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found that turbo-frame contains #repo-content-pjax-container on the first load and then it's gone. Select will return the first element matching the selector, which is always turbo-frame since it's the parent

@fregante
fregante merged commit 09466a8 into main Jul 1, 2022
@fregante
fregante deleted the turbo-frame branch July 1, 2022 12:28
@fregante fregante changed the title Avoid duplicate features on history navigation Fix duplication of features on back/forward button click Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

#repo-content-pjax-container is gone

1 participant