Function leptos_use::use_active_element

source ·
pub fn use_active_element() -> Signal<Option<HtmlElement<AnyElement>>>
Expand description

Reactive document.activeElement

§Demo

Link to Demo

§Usage

use leptos_use::use_active_element;
let active_element = use_active_element();

create_effect(move |_| {
    log!("focus changed to {:?}", active_element.get());
});

§Server-Side Rendering

On the server this returns a Signal that always contains the value None.