MCPcopy Index your code
hub / github.com/Tailframes/react-components / updateDropdownPosition

Function updateDropdownPosition

components/select/select.tsx:170–179  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

168
169 useLayoutEffect(() => {
170 const updateDropdownPosition = () => {
171 if (isOpened && buttonRef.current) {
172 const buttonRect = buttonRef.current.getBoundingClientRect();
173 setDropdownPosition({
174 top: buttonRect.bottom + window.scrollY + 8,
175 left: buttonRect.left + window.scrollX,
176 width: buttonRect.width,
177 });
178 }
179 };
180
181 updateDropdownPosition();
182 window.addEventListener('resize', updateDropdownPosition);

Callers 1

SelectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected