MCPcopy Create free account
hub / github.com/ReactTooltip/react-tooltip / removeAriaDescribedBy

Function removeAriaDescribedBy

src/components/Tooltip/Tooltip.tsx:148–155  ·  view source on GitHub ↗
(element: Element | null)

Source from the content-addressed store, hash-verified

146 }
147
148 function removeAriaDescribedBy(element: Element | null) {
149 const newDescribedBy = getAriaDescribedBy(element).filter((s) => s !== id)
150 if (newDescribedBy.length) {
151 element?.setAttribute('aria-describedby', newDescribedBy.join(' '))
152 } else {
153 element?.removeAttribute('aria-describedby')
154 }
155 }
156
157 if (show) {
158 removeAriaDescribedBy(previousActiveAnchor)

Callers 1

TooltipFunction · 0.85

Calls 1

getAriaDescribedByFunction · 0.85

Tested by

no test coverage detected