Home / Function/ bind_active_element() — svelte Function Reference

bind_active_element() — svelte Function Reference

Architecture documentation for the bind_active_element() function in document.js from the svelte codebase.

Entity Profile

Dependency Diagram

graph TD
  8af60d9c_9d06_c69e_e5d9_e5f4811fc212["bind_active_element()"]
  bb75dac7_8bcf_2d4b_80fd_684f4431a04c["document.js"]
  8af60d9c_9d06_c69e_e5d9_e5f4811fc212 -->|defined in| bb75dac7_8bcf_2d4b_80fd_684f4431a04c
  da178604_a1e6_1104_9d60_daf043f014c9["listen()"]
  8af60d9c_9d06_c69e_e5d9_e5f4811fc212 -->|calls| da178604_a1e6_1104_9d60_daf043f014c9
  style 8af60d9c_9d06_c69e_e5d9_e5f4811fc212 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/internal/client/dom/elements/bindings/document.js lines 7–17

export function bind_active_element(update) {
	listen(document, ['focusin', 'focusout'], (event) => {
		if (event && event.type === 'focusout' && /** @type {FocusEvent} */ (event).relatedTarget) {
			// The tests still pass if we remove this, because of JSDOM limitations, but it is necessary
			// to avoid temporarily resetting to `document.body`
			return;
		}

		update(document.activeElement);
	});
}

Domain

Subdomains

Calls

Frequently Asked Questions

What does bind_active_element() do?
bind_active_element() is a function in the svelte codebase, defined in packages/svelte/src/internal/client/dom/elements/bindings/document.js.
Where is bind_active_element() defined?
bind_active_element() is defined in packages/svelte/src/internal/client/dom/elements/bindings/document.js at line 7.
What does bind_active_element() call?
bind_active_element() calls 1 function(s): listen.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free