MCPcopy Create free account
hub / github.com/adobe/react-spectrum / scroll

Function scroll

packages/react-aria/src/overlays/usePreventScroll.ts:234–240  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

232
233 if (!opts || !opts.preventScroll) {
234 let scroll = () => {
235 let activeElement = getActiveElement();
236
237 if (activeElement === this) {
238 scrollIntoView(this);
239 }
240 };
241
242 runAfterKeyboard(isOpen =>
243 isOpen ? scroll() : runAfterKeyboardTransition(() => scroll())

Callers 1

overrideFocusFunction · 0.70

Calls 2

getActiveElementFunction · 0.90
scrollIntoViewFunction · 0.70

Tested by

no test coverage detected