MCPcopy
hub / github.com/PostHog/posthog / clearDOMTextSelection

Function clearDOMTextSelection

frontend/src/lib/utils.tsx:436–449  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

434}
435
436export function clearDOMTextSelection(): void {
437 if (window.getSelection) {
438 if (window.getSelection()?.empty) {
439 // Chrome
440 window.getSelection()?.empty()
441 } else if (window.getSelection()?.removeAllRanges) {
442 // Firefox
443 window.getSelection()?.removeAllRanges()
444 }
445 } else if ((document as any).selection) {
446 // IE?
447 ;(document as any).selection.empty()
448 }
449}
450
451export function slugify(text: string): string {
452 return text

Callers 1

dashboardLogic.tsxFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…