MCPcopy
hub / github.com/aidenybai/react-grab / setSearchInputValue

Function setSearchInputValue

packages/react-grab/e2e/edit-panel-helpers.ts:295–311  ·  view source on GitHub ↗
(page: Page, value: string)

Source from the content-addressed store, hash-verified

293};
294
295export const setSearchInputValue = async (page: Page, value: string): Promise<void> => {
296 await page.evaluate(
297 ({ attrName, inputAttr, nextValue }) => {
298 const host = document.querySelector(`[${attrName}]`);
299 const shadowRoot = host?.shadowRoot;
300 if (!shadowRoot) throw new Error("No shadow root");
301 const input = shadowRoot.querySelector<HTMLTextAreaElement>(`[${inputAttr}]`);
302 if (!input) throw new Error("Search input not found");
303 input.focus();
304 input.value = nextValue;
305 input.dispatchEvent(
306 new InputEvent("input", { bubbles: true, composed: true, data: nextValue }),
307 );
308 },
309 { attrName: ATTRIBUTE_NAME, inputAttr: SEARCH_INPUT_ATTR, nextValue: value },
310 );
311};
312
313export const getInlineStyleProperty = async (
314 page: Page,

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…