()
| 14 | } |
| 15 | |
| 16 | export function getSearchPrefillSelection(): string | null { |
| 17 | if (isMonacoFocused()) { |
| 18 | return null |
| 19 | } |
| 20 | |
| 21 | const activeElement = document.activeElement |
| 22 | const inputSelection = getSelectedTextFromInput(activeElement) |
| 23 | const rawSelection = inputSelection ?? window.getSelection()?.toString() ?? '' |
| 24 | const trimmedSelection = rawSelection.trim() |
| 25 | |
| 26 | return trimmedSelection.length > 0 ? trimmedSelection : null |
| 27 | } |
no test coverage detected