Socket
Socket
Sign inDemoInstall

@react-aria/utils

Package Overview
Dependencies
Maintainers
2
Versions
773
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-aria/utils - npm Package Compare versions

Comparing version 3.0.0-nightly.2840 to 3.0.0-nightly.2843

src/getScrollParents.ts

3

dist/types.d.ts

@@ -167,4 +167,5 @@ import React, { ForwardedRef, MutableRefObject, ReactNode, HTMLAttributes, EffectCallback, RefObject, Dispatch } from "react";

export function useSyncRef<T>(context?: ContextValue<T> | null, ref?: RefObject<T>): void;
export function isScrollable(node: Element, checkForOverflow?: boolean): boolean;
export function getScrollParent(node: Element, checkForOverflow?: boolean): Element;
export function isScrollable(node: Element, checkForOverflow?: boolean): boolean;
export function getScrollParents(node: Element, checkForOverflow?: boolean): Element[];
interface ViewportSize {

@@ -171,0 +172,0 @@ width: number;

{
"name": "@react-aria/utils",
"version": "3.0.0-nightly.2840+64ed13090",
"version": "3.0.0-nightly.2843+81162ea39",
"description": "Spectrum UI components in React",

@@ -25,5 +25,5 @@ "license": "Apache-2.0",

"dependencies": {
"@react-aria/ssr": "3.9.3-nightly.4552+64ed13090",
"@react-stately/utils": "3.0.0-nightly.2840+64ed13090",
"@react-types/shared": "3.0.0-nightly.2840+64ed13090",
"@react-aria/ssr": "3.9.3-nightly.4555+81162ea39",
"@react-stately/utils": "3.0.0-nightly.2843+81162ea39",
"@react-types/shared": "3.0.0-nightly.2843+81162ea39",
"@swc/helpers": "^0.5.0",

@@ -38,3 +38,3 @@ "clsx": "^2.0.0"

},
"gitHead": "64ed13090ce77cc0e4cb4cd5602e75f655bff6bb"
"gitHead": "81162ea392926d06ec3d25c228e6f9b6b5479d59"
}

@@ -13,2 +13,4 @@ /*

import {isScrollable} from './isScrollable';
export function getScrollParent(node: Element, checkForOverflow?: boolean): Element {

@@ -27,11 +29,1 @@ let scrollableNode: Element | null = node;

export function isScrollable(node: Element, checkForOverflow?: boolean): boolean {
let style = window.getComputedStyle(node);
let isScrollable = /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);
if (isScrollable && checkForOverflow) {
isScrollable = node.scrollHeight !== node.clientHeight || node.scrollWidth !== node.clientWidth;
}
return isScrollable;
}

@@ -30,3 +30,5 @@ /*

export {useSyncRef} from './useSyncRef';
export {getScrollParent, isScrollable} from './getScrollParent';
export {getScrollParent} from './getScrollParent';
export {getScrollParents} from './getScrollParents';
export {isScrollable} from './isScrollable';
export {useViewportSize} from './useViewportSize';

@@ -33,0 +35,0 @@ export {useDescription} from './useDescription';

@@ -13,3 +13,3 @@ /*

import {getScrollParent} from './';
import {getScrollParents} from './getScrollParents';

@@ -103,8 +103,6 @@ interface ScrollIntoViewportOpts {

} else {
let scrollParent = getScrollParent(targetElement);
let scrollParents = getScrollParents(targetElement);
// If scrolling is prevented, we don't want to scroll the body since it might move the overlay partially offscreen and the user can't scroll it back into view.
while (targetElement && scrollParent && targetElement !== root && scrollParent !== root) {
for (let scrollParent of scrollParents) {
scrollIntoView(scrollParent as HTMLElement, targetElement as HTMLElement);
targetElement = scrollParent;
scrollParent = getScrollParent(targetElement);
}

@@ -111,0 +109,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc