MCPcopy Create free account
hub / github.com/react-component/select / onInternalSearchSplit

Function onInternalSearchSplit

src/Select.tsx:599–616  ·  view source on GitHub ↗
(words)

Source from the content-addressed store, hash-verified

597 };
598
599 const onInternalSearchSplit: BaseSelectProps['onSearchSplit'] = (words) => {
600 let patchValues: RawValueType[] = words;
601
602 if (mode !== 'tags') {
603 patchValues = words
604 .map((word) => {
605 const opt = labelOptions.get(word);
606 return opt?.value;
607 })
608 .filter((val) => val !== undefined);
609 }
610
611 const newRawValues = Array.from(new Set<RawValueType>([...rawValues, ...patchValues]));
612 triggerChange(newRawValues);
613 newRawValues.forEach((newRawValue) => {
614 triggerSelect(newRawValue, true);
615 });
616 };
617
618 // ========================== Context ===========================
619 const selectContext = React.useMemo<SelectContextProps>(() => {

Callers

nothing calls this directly

Calls 2

triggerChangeFunction · 0.85
triggerSelectFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…