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

Method getOptions

packages/@react-aria/test-utils/src/select.ts:241–249  ·  view source on GitHub ↗

* Returns the select's options if present. Can be filtered to a subsection of the listbox if * provided via `element`.

(opts: {element?: HTMLElement} = {})

Source from the content-addressed store, hash-verified

239 * provided via `element`.
240 */
241 getOptions(opts: {element?: HTMLElement} = {}): HTMLElement[] {
242 let {element = this.getListbox()} = opts;
243 let options = [];
244 if (element) {
245 options = within(element).queryAllByRole('option');
246 }
247
248 return options;
249 }
250
251 /**
252 * Returns the select's trigger.

Callers 2

findOptionMethod · 0.95

Calls 1

getListboxMethod · 0.95

Tested by

no test coverage detected