Repository: gradio-app/gradio
File: js/atoms/src/Block.svelte (Svelte)

Code before:
	export let border_mode: "base" | "focus" | "contrast" = "base";
	export let padding = true;
	export let type: "normal" | "fieldset" = "normal";
	export let test_id: string | undefined = undefined;
	export let explicit_call = false;
	export let container = true;
	export let visible = true;
	export let allow_overflow = true;
	export let overflow_behavior: "visible" | "auto" = "auto";
	export let scale: number | null = null;
	export let min_width = 0;
	export let flex = false;
	export let resizable = false;
	export let rtl = false;
	export let fullscreen = false;
	let old_fullscreen = fullscreen;

	let element: HTMLElement;

	let tag = type === "fieldset" ? "fieldset" : "div";

	let placeholder_height = 0;
	let placeholder_width = 0;
	let preexpansionBoundingRect: DOMRect | null = null;

	function handleKeydown(event: KeyboardEvent) {
		if (fullscreen && event.key === "Escape") {
			fullscreen = false;
		}
	}

	$: if (fullscreen !== old_fullscreen) {
		old_fullscreen = fullscreen;
		if (fullscreen) {
			preexpansionBoundingRect = element.getBoundingClientRect();
			placeholder_height = element.offsetHeight;
			placeholder_width = element.offsetWidth;
			window.addEventListener("keydown", handleKeydown);
		} else {
			preexpansionBoundingRect = null;
			window.removeEventListener("keydown", handleKeydown);
		}
	}

	const get_dimension = (
		dimension_value: string | number | undefined
	): string | undefined => {
		if (dimension_value === undefined) {
			return undefined;
		}
		if (typeof dimension_value === "number") {

Review comment (suggestion):

```suggestion
	function handleKeydown(event: KeyboardEvent): void {
```

Code after:
	export let border_mode: "base" | "focus" | "contrast" = "base";
	export let padding = true;
	export let type: "normal" | "fieldset" = "normal";
	export let test_id: string | undefined = undefined;
	export let explicit_call = false;
	export let container = true;
	export let visible = true;
	export let allow_overflow = true;
	export let overflow_behavior: "visible" | "auto" = "auto";
	export let scale: number | null = null;
	export let min_width = 0;
	export let flex = false;
	export let resizable = false;
	export let rtl = false;
	export let fullscreen = false;
	let old_fullscreen = fullscreen;

	let element: HTMLElement;

	let tag = type === "fieldset" ? "fieldset" : "div";

	let placeholder_height = 0;
	let placeholder_width = 0;
	let preexpansionBoundingRect: DOMRect | null = null;

	function handleKeydown(event: KeyboardEvent): void {
		if (fullscreen && event.key === "Escape") {
			fullscreen = false;
		}
	}

	$: if (fullscreen !== old_fullscreen) {
		old_fullscreen = fullscreen;
		if (fullscreen) {
			preexpansionBoundingRect = element.getBoundingClientRect();
			placeholder_height = element.offsetHeight;
			placeholder_width = element.offsetWidth;
			window.addEventListener("keydown", handleKeydown);
		} else {
			preexpansionBoundingRect = null;
			window.removeEventListener("keydown", handleKeydown);
		}
	}

	const get_dimension = (
		dimension_value: string | number | undefined
	): string | undefined => {
		if (dimension_value === undefined) {
			return undefined;
		}
		if (typeof dimension_value === "number") {