MCPcopy Create free account
hub / github.com/adobe/react-spectrum / open

Function open

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

Source from the content-addressed store, hash-verified

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

Callers 1

showTooltipFunction · 0.50

Calls 1

openMethod · 0.65

Tested by

no test coverage detected