From 116c4f5eb0ddf4dddbd10005bc72a7e6cb880a67 Mon Sep 17 00:00:00 2001 From: Chris Swithinbank Date: Thu, 25 May 2023 11:34:29 +0200 Subject: [PATCH] Fix small RTL layout bug in Search component --- .changeset/sour-beans-cry.md | 5 +++++ packages/starlight/components/Search.astro | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 .changeset/sour-beans-cry.md diff --git a/.changeset/sour-beans-cry.md b/.changeset/sour-beans-cry.md new file mode 100644 index 0000000000..33e807eb37 --- /dev/null +++ b/.changeset/sour-beans-cry.md @@ -0,0 +1,5 @@ +--- +"@astrojs/starlight": patch +--- + +Fix minor dev layout bug in Search modal for RTL languages diff --git a/packages/starlight/components/Search.astro b/packages/starlight/components/Search.astro index 6e58b46df7..08684d04c2 100644 --- a/packages/starlight/components/Search.astro +++ b/packages/starlight/components/Search.astro @@ -34,7 +34,7 @@ const t = useTranslations(Astro.props.locale); { import.meta.env.DEV ? ( -
+

Search is only available in production builds.

Try building and previewing the site to test it out locally.

@@ -63,7 +63,11 @@ const t = useTranslations(Astro.props.locale); /** Close the modal if a user clicks outside of the modal. */ const onWindowClick = (event: MouseEvent) => { - if (document.body.contains(event.target as Node) && !dialogFrame.contains(event.target as Node)) closeModal(); + if ( + document.body.contains(event.target as Node) && + !dialogFrame.contains(event.target as Node) + ) + closeModal(); }; const openModal = (event?: MouseEvent) => {