Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: handle optional chaining for offsetTop in scroll.ts
Refactor the code in scroll.ts to handle optional chaining (?.) for the offsetTop property. This ensures that the code doesn't throw an error when ref.current is null or undefined. The offsetTop value is used in the calculation of scrollPositionRelativeToRef. This fix addresses a potential bug where the code could break if ref.current is not available.
- Loading branch information