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

Function getCell

packages/@adobe/react-spectrum/test/table/TableTests.js:236–244  ·  view source on GitHub ↗
(tree, text)

Source from the content-addressed store, hash-verified

234 };
235 // I'd use tree.getByRole(role, {name: text}) here, but it's unbearably slow.
236 let getCell = (tree, text) => {
237 // Find by text, then go up to the element with the cell role.
238 let el = tree.getByText(text);
239 while (el && !/gridcell|rowheader|columnheader/.test(el.getAttribute('role'))) {
240 el = el.parentElement;
241 }
242
243 return el;
244 };
245
246 let focusCell = (tree, text) => act(() => getCell(tree, text).focus());
247 let moveFocus = (key, opts = {}) => {

Callers 2

focusCellFunction · 0.70
TableTests.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected