MCPcopy
hub / github.com/JedWatson/react-select / Select

Class Select

packages/react-select/src/Select.tsx:625–2248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

623let instanceId = 1;
624
625export default class Select<
626 Option = unknown,
627 IsMulti extends boolean = false,
628 Group extends GroupBase<Option> = GroupBase<Option>
629> extends Component<
630 Props<Option, IsMulti, Group>,
631 State<Option, IsMulti, Group>
632> {
633 static defaultProps = defaultProps;
634 state: State<Option, IsMulti, Group> = {
635 ariaSelection: null,
636 focusedOption: null,
637 focusedOptionId: null,
638 focusableOptionsWithIds: [],
639 focusedValue: null,
640 inputIsHidden: false,
641 isFocused: false,
642 selectValue: [],
643 clearFocusValueOnUpdate: false,
644 prevWasFocused: false,
645 inputIsHiddenAfterUpdate: undefined,
646 prevProps: undefined,
647 instancePrefix: '',
648 isAppleDevice: false,
649 };
650
651 // Misc. Instance Properties
652 // ------------------------------
653
654 blockOptionHover = false;
655 isComposing = false;
656 commonProps: any; // TODO
657 initialTouchX = 0;
658 initialTouchY = 0;
659 openAfterFocus = false;
660 scrollToFocusedOptionOnUpdate = false;
661 userIsDragging?: boolean;
662
663 // Refs
664 // ------------------------------
665
666 controlRef: HTMLDivElement | null = null;
667 getControlRef: RefCallback<HTMLDivElement> = (ref) => {
668 this.controlRef = ref;
669 };
670 focusedOptionRef: HTMLDivElement | null = null;
671 getFocusedOptionRef: RefCallback<HTMLDivElement> = (ref) => {
672 this.focusedOptionRef = ref;
673 };
674 menuListRef: HTMLDivElement | null = null;
675 getMenuListRef: RefCallback<HTMLDivElement> = (ref) => {
676 this.menuListRef = ref;
677 };
678 inputRef: HTMLInputElement | null = null;
679 getInputRef: RefCallback<HTMLInputElement> = (ref) => {
680 this.inputRef = ref;
681 };
682

Callers

nothing calls this directly

Calls 15

onInputChangeMethod · 0.95
onMenuCloseMethod · 0.95
isOptionSelectedMethod · 0.95
isOptionDisabledMethod · 0.95
blurInputMethod · 0.95
focusInputMethod · 0.95
openMenuMethod · 0.95
onMenuOpenMethod · 0.95
focusValueMethod · 0.95
focusOptionMethod · 0.95
multiValueAsValueFunction · 0.90
singleValueAsValueFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…