Skip to content

Commit

Permalink
Update scroll-into-view pkg and fix scroll behavior bug [#816]
Browse files Browse the repository at this point in the history
  • Loading branch information
ericgio committed Oct 19, 2023
1 parent 69fd445 commit 348ec54
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"prop-types": "^15.5.8",
"react-overlays": "^5.2.0",
"react-popper": "^2.2.5",
"scroll-into-view-if-needed": "^2.2.20",
"scroll-into-view-if-needed": "^3.1.0",
"warning": "^4.0.1"
},
"peerDependencies": {
Expand Down
4 changes: 1 addition & 3 deletions src/behaviors/item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,11 @@ export function useItem<T extends HTMLElement>({

node &&
scrollIntoView(node, {
block: 'nearest',
boundary: node.parentNode as Element,
inline: 'nearest',
scrollMode: 'if-needed',
});
}
});
}, [activeIndex, onActiveItemChange, option, position]);

const handleClick = useCallback(
(e: MouseEvent<T>) => {
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5160,10 +5160,10 @@ compression@^1.7.4:
safe-buffer "5.1.2"
vary "~1.1.2"

compute-scroll-into-view@^1.0.20:
version "1.0.20"
resolved "https://registry.yarnpkg.com/compute-scroll-into-view/-/compute-scroll-into-view-1.0.20.tgz#1768b5522d1172754f5d0c9b02de3af6be506a43"
integrity sha512-UCB0ioiyj8CRjtrvaceBLqqhZCVP+1B8+NWQhmdsm0VXOJtobBCf1dBQmebCCo34qZmUwZfIH2MZLqNHazrfjg==
compute-scroll-into-view@^3.0.2:
version "3.1.0"
resolved "https://registry.yarnpkg.com/compute-scroll-into-view/-/compute-scroll-into-view-3.1.0.tgz#753f11d972596558d8fe7c6bcbc8497690ab4c87"
integrity sha512-rj8l8pD4bJ1nx+dAkMhV1xB5RuZEyVysfxJqB1pRchh1KVvwOv9b7CGB8ZfjTImVv2oF+sYMUkMZq6Na5Ftmbg==

concat-map@0.0.1:
version "0.0.1"
Expand Down Expand Up @@ -11589,12 +11589,12 @@ schema-utils@^3.0.0, schema-utils@^3.1.1, schema-utils@^3.2.0:
ajv "^6.12.5"
ajv-keywords "^3.5.2"

scroll-into-view-if-needed@^2.2.20:
version "2.2.31"
resolved "https://registry.yarnpkg.com/scroll-into-view-if-needed/-/scroll-into-view-if-needed-2.2.31.tgz#d3c482959dc483e37962d1521254e3295d0d1587"
integrity sha512-dGCXy99wZQivjmjIqihaBQNjryrz5rueJY7eHfTdyWEiR4ttYpsajb14rn9s5d4DY4EcY6+4+U/maARBXJedkA==
scroll-into-view-if-needed@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/scroll-into-view-if-needed/-/scroll-into-view-if-needed-3.1.0.tgz#fa9524518c799b45a2ef6bbffb92bcad0296d01f"
integrity sha512-49oNpRjWRvnU8NyGVmUaYG4jtTkNonFZI86MmGRDqBphEK2EXT9gdEUoQPZhuBM8yWHxCWbobltqYO5M4XrUvQ==
dependencies:
compute-scroll-into-view "^1.0.20"
compute-scroll-into-view "^3.0.2"

"semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.5.0, semver@^5.6.0:
version "5.7.2"
Expand Down

0 comments on commit 348ec54

Please sign in to comment.