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

Function getSelectedOption

core/src/utils/watch-options.ts:20–29  ·  view source on GitHub ↗
(mutationList: MutationRecord[], tagName: string)

Source from the content-addressed store, hash-verified

18};
19
20const getSelectedOption = <T extends HTMLElement>(mutationList: MutationRecord[], tagName: string): T | undefined => {
21 let newOption: T | undefined;
22 mutationList.forEach((mut) => {
23 // eslint-disable-next-line @typescript-eslint/prefer-for-of
24 for (let i = 0; i < mut.addedNodes.length; i++) {
25 newOption = findCheckedOption<T>(mut.addedNodes[i], tagName) || newOption;
26 }
27 });
28 return newOption;
29};
30
31/**
32 * The "value" key is only set on some components such as ion-select-option.

Callers 1

watchForOptionsFunction · 0.85

Calls 1

findCheckedOptionFunction · 0.85

Tested by

no test coverage detected