Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Jodekq committed Feb 12, 2024
1 parent fa99d61 commit d3f6f21
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/client/fridge/_src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ document.addEventListener('DOMContentLoaded', () => {
const container = document.querySelector(`.fridge-content-container[data-category="${selectedCategory}"]`);
if (container) {
const containerRect = container.getBoundingClientRect();
const offset = containerRect.top + window.scrollY - wrapper.getBoundingClientRect().top - (wrapper.clientHeight - containerRect.height) / 2;
const offset = containerRect.top + globalThis.scrollY - wrapper.getBoundingClientRect().top - (wrapper.clientHeight - containerRect.height) / 2;

wrapper.scrollTo({
top: offset + wrapper.scrollTop,
Expand Down

0 comments on commit d3f6f21

Please sign in to comment.