MCPcopy
hub / github.com/angular/components / _getCell

Method _getCell

src/aria/grid/grid.ts:182–198  ·  view source on GitHub ↗

Gets the cell pattern for a given element.

(element: Element | null | undefined)

Source from the content-addressed store, hash-verified

180
181 /** Gets the cell pattern for a given element. */
182 private _getCell(element: Element | null | undefined): GridCellPattern | undefined {
183 let target = element;
184
185 while (target) {
186 for (const row of this._rowPatterns()) {
187 for (const cell of row.inputs.cells()) {
188 if (cell.element() === target) {
189 return cell;
190 }
191 }
192 }
193
194 target = target.parentElement?.closest('[ngGridCell]');
195 }
196
197 return undefined;
198 }
199}

Callers 1

GridClass · 0.95

Calls 1

elementMethod · 0.45

Tested by

no test coverage detected