gatsby-starter-level-2 icon indicating copy to clipboard operation
gatsby-starter-level-2 copied to clipboard

Fix back-to-top button

Open Knochenmark opened this issue 4 years ago • 7 comments

Button is there, but must have been broken with the Gatsby 3 migration

Knochenmark avatar Oct 02 '21 11:10 Knochenmark

When I click it, it seems to work

trybick avatar Oct 02 '21 11:10 trybick

I figured it seems to be my adblocker that is removing the button. Therefore it might just be a case of finding a classname that isn't on the blacklist of the adblocker. I had a similar issue before with the "social-icons".

If you are eager to fix it. I'm using "AdBlock" on Chrome.

It looks like the button is targeted by the aria-label & a data-attr with test-id.

Knochenmark avatar Oct 02 '21 12:10 Knochenmark

Gotcha, I can give that a shot

trybick avatar Oct 02 '21 12:10 trybick

It looks like the data-test-id is hardcoded into that library https://github.com/dirtyredz/react-scroll-up-button/blob/master/src/react-scroll-up-button.js#L180

This may require more digging that I'm able to commit to at the moment

trybick avatar Oct 02 '21 13:10 trybick

@trybick Ok, but you could reproduce it as well, right? Thanks for trying though.

Worst case I have to drop and replace that scroll up library

Knochenmark avatar Oct 02 '21 13:10 Knochenmark

I use uBlock for chrome for adblocking so I didn't try with that extension. If you haven't already maybe try incognito mode without that extension and then enable that extension in incognito to make sure that's the cause.

trybick avatar Oct 02 '21 13:10 trybick

Yeah, it's working on incognito and when I disable the extension. It worked before, so my assumption is, that the button was just added to some official list at some point. Unfortunately it's targeted via that testing-id attribute too and not just by that aria-label.

Knochenmark avatar Oct 02 '21 13:10 Knochenmark