MCPcopy Create free account
hub / github.com/ionic-team/ionic-framework / getIndexOfItem

Function getIndexOfItem

core/src/components/popover/utils.ts:360–366  ·  view source on GitHub ↗
(items: HTMLIonItemElement[], item: HTMLElement | null)

Source from the content-addressed store, hash-verified

358 * Returns the index of an ion-item in an array of ion-items.
359 */
360export const getIndexOfItem = (items: HTMLIonItemElement[], item: HTMLElement | null) => {
361 if (!item || item.tagName !== 'ION-ITEM') {
362 return -1;
363 }
364
365 return items.findIndex((el) => el === item);
366};
367
368/**
369 * Given an array of elements and a currently focused ion-item

Callers 3

util.spec.tsFile · 0.90
getNextItemFunction · 0.85
getPrevItemFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected