activeElementStore

Reactive document.activeElement

Demo

Select the inputs below to see the changes

Current active element id: null

Usage

<script lang="ts">
import { activeElementStore } from 'svelte-legos';

const activeElement = activeElementStore();

$: {
  // use $activeElement here if not null
}
</script>