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

Function selectedText

packages/@react-spectrum/ai/test/PromptField.test.tsx:40–41  ·  view source on GitHub ↗
(v: PromptFieldValue)

Source from the content-addressed store, hash-verified

38let queryMenuItem = (name: string | RegExp) => screen.queryByRole('menuitem', {name});
39
40let selectedText = (v: PromptFieldValue) =>
41 v.slice(v.selectedRange.start, v.selectedRange.end).toString();
42
43// A prompt containing both a fillable object placeholder (Journey) and a free-text placeholder (Date).
44function placeholderPrompt(): PromptFieldValue {

Callers 1

Calls 2

sliceMethod · 0.80
toStringMethod · 0.65

Tested by

no test coverage detected