Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String in config's scrollOffset is off by 24px #2739

Closed
Yutsuten opened this issue Aug 6, 2023 · 1 comment
Closed

String in config's scrollOffset is off by 24px #2739

Yutsuten opened this issue Aug 6, 2023 · 1 comment

Comments

@Yutsuten
Copy link

Yutsuten commented Aug 6, 2023

Using 1.0.0-beta.7.

I'm using the scrollOffset site config with a selector (string) in my custom theme, and when the selector matches, the scroll jump is off by 24px due to this code:

src/client/app/router.ts#L309

function tryOffsetSelector(selector: string): number {
  const el = document.querySelector(selector)
  if (!el) return 0
  const bot = el.getBoundingClientRect().bottom
  if (bot < 0) return 0
  return bot + 24  // <== THIS
}

Could you remove the hard-coded value 24, please? If anything, make it configurable.

@brc-dd brc-dd closed this as completed in 20b509c Aug 7, 2023
@Yutsuten
Copy link
Author

Yutsuten commented Aug 7, 2023

Thank you very much!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant