Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ehconitin committed Jan 23, 2025
1 parent a3dbeb5 commit 3eb10ea
Showing 1 changed file with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,18 @@ export const ScrollWrapper = ({
},
events: {
updated: (osInstance) => {
const { scrollOffsetElement: target } = osInstance.elements();
const {
scrollOffsetElement: target,
scrollbarVertical,
scrollbarHorizontal,
} = osInstance.elements();

if (scrollbarVertical !== null) {
scrollbarVertical.track.dataset.selectDisable = 'true';
}
if (scrollbarHorizontal !== null) {
scrollbarHorizontal.track.dataset.selectDisable = 'true';
}
setScrollBottom(
target.scrollHeight - target.clientHeight - target.scrollTop,
);
Expand Down Expand Up @@ -175,13 +186,6 @@ export const ScrollWrapper = ({
const currentRef = scrollableRef.current;
if (currentRef !== null) {
initialize(currentRef);
// Add data-select-disable to scrollbars
const scrollbars = currentRef.querySelectorAll('.os-scrollbar');
scrollbars.forEach((scrollbar) => {
if (scrollbar instanceof HTMLElement) {
scrollbar.dataset.selectDisable = 'true';
}
});
}
return () => {
// Reset vertical scroll component-specific Recoil state
Expand Down

0 comments on commit 3eb10ea

Please sign in to comment.