MCPcopy Index your code
hub / github.com/adobe/react-spectrum / open

Function open

packages/react-stately/src/select/useSelectState.ts:254–260  ·  view source on GitHub ↗
(focusStrategy: FocusStrategy | null = null)

Source from the content-addressed store, hash-verified

252 props.defaultSelectedKey ?? (props.selectionMode === 'single' ? (initialValue as Key) : null),
253 focusStrategy,
254 open(focusStrategy: FocusStrategy | null = null) {
255 // Don't open if the collection is empty.
256 if (listState.collection.size !== 0 || props.allowsEmptyCollection) {
257 setFocusStrategy(focusStrategy);
258 triggerState.open();
259 }
260 },
261 toggle(focusStrategy: FocusStrategy | null = null) {
262 if (listState.collection.size !== 0 || props.allowsEmptyCollection) {
263 setFocusStrategy(focusStrategy);

Callers 5

getSyntheticLinkFunction · 0.50
showTooltipFunction · 0.50
SearchMenuTriggerFunction · 0.50
handleKeyDownFunction · 0.50
handleCustomEventFunction · 0.50

Calls 1

openMethod · 0.65

Tested by

no test coverage detected