MCPcopy Index your code
hub / github.com/ionic-team/ionic-framework / textForValue

Function textForValue

core/src/components/select/select.tsx:1318–1327  ·  view source on GitHub ↗
(
  opts: HTMLIonSelectOptionElement[],
  value: any,
  compareWith?: string | SelectCompareFn | null
)

Source from the content-addressed store, hash-verified

1316};
1317
1318const textForValue = (
1319 opts: HTMLIonSelectOptionElement[],
1320 value: any,
1321 compareWith?: string | SelectCompareFn | null
1322): string | null => {
1323 const selectOpt = opts.find((opt) => {
1324 return compareOptions(value, getOptionValue(opt), compareWith);
1325 });
1326 return selectOpt ? selectOpt.textContent : null;
1327};
1328
1329let selectIds = 0;
1330

Callers 1

generateTextFunction · 0.85

Calls 2

compareOptionsFunction · 0.90
getOptionValueFunction · 0.85

Tested by

no test coverage detected