UNPKG

@splidejs/splide

Version:

Splide is a lightweight, flexible and accessible slider/carousel. No dependencies, no Lighthouse errors.

9 lines (8 loc) 267 B
/** * Focuses the provided element without scrolling the ascendant element. * * @param elm - An element to focus. */ export function focus( elm: HTMLElement ): void { elm[ 'setActive' ] && elm[ 'setActive' ]() || elm.focus( { preventScroll: true } ); }