(items: HTMLIonItemElement[], item: HTMLElement | null)
| 358 | * Returns the index of an ion-item in an array of ion-items. |
| 359 | */ |
| 360 | export 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 |
no outgoing calls
no test coverage detected