Cookie consent banner scrolls iPhone visitors to the bottom of the page on first load

Is anyone else seeing this?

Recently, with no changes on our side, first-time/incognito visitors on iPhone (Safari and Chrome on iOS) are scrolled straight to the bottom of the page when the HubSpot cookie consent banner appears. Desktop and Android are fine.

Cause, as far as we can tell from the current banner.js:

  • The banner is rendered at translateY(200vh) until window load, when the “hs-banner-optimization-animation” class slides it in.
  • The banner’s focus trap calls focus() on render, without preventScroll.
  • iOS WebKit scrolls to the focused element while it is still 200vh off-screen.

Workaround that fixed it for us…
(place at the top of Settings > Content > Pages > Site header HTML):

We’ve reported it to HubSpot Support.
It would help if others affected could reply here so it gets prioritised.

Hi @Tim_Sheds,

Thanks for sharing your findings with the HubSpot Community and taking the time to investigate this!

Great to hear you’ve already reported this to our Support Team.

Here are some resources on the topic:

I’d be interested to hear if others in the Community are experiencing the same behavior. If so, please share your findings and any workarounds you’ve tested!

Hi @Anton, @nickdeckerdevs1 and @alyssamwilie do you see the same on your end, please?

Thanks so much,

Bérangère

We are having the same issue. Only on iphones. Not good because its on our landing pages from our ads. What can HubSpot do to escalate?

Hi @KHudson1 and all, welcome to the HubSpot Community!

Thanks for flagging this! I see that the Support ticket you opened is being handled currently and the Team is currently investigating this as we speak.

I’ll share an update here as soon as I have more information.

Thanks for your patience!

Bérangère

Hi @KHudson1 and @Tim_Sheds,

Sharing here the outcome from our Support Team: I can confirm that a fix has been successfully deployed to all HubSpot accounts, including yours. You should no longer need the temporary workaround you implemented.

I recommend testing the banner without it in an incognito/private browsing session on an iPhone to confirm everything works as expected.

Please let our Support Team know if you notice any unexpected behavior during testing!

Thanks,
Bérangère