fix(Settings): scroll sections error

This commit is contained in:
Tim 2025-11-28 14:53:46 +01:00
parent 1f93175e98
commit cb74f3be65

View file

@ -42,7 +42,7 @@ const Settings = () => {
setSelectedSectionId(sections[sections.length - 1].id);
} else {
for (let i = sections.length - 1; i >= 0; i--) {
if (sections[i].ref.current!.offsetTop - container!.offsetTop <= container!.scrollTop) {
if (sections[i].ref.current && sections[i].ref.current!.offsetTop - container!.offsetTop <= container!.scrollTop) {
setSelectedSectionId(sections[i].id);
break;
}