diff options
author | Chris Swithinbank | 2023-05-25 11:34:29 +0200 |
---|---|---|
committer | Chris Swithinbank | 2023-05-25 11:34:29 +0200 |
commit | 116c4f5eb0ddf4dddbd10005bc72a7e6cb880a67 (patch) | |
tree | 25cf0b50314794a8f7f23865ffda611428463155 | |
parent | 86887786d158e4cdb9e4bd021b2232eb6dba284c (diff) | |
download | IT.starlight-116c4f5eb0ddf4dddbd10005bc72a7e6cb880a67.tar.gz IT.starlight-116c4f5eb0ddf4dddbd10005bc72a7e6cb880a67.tar.bz2 IT.starlight-116c4f5eb0ddf4dddbd10005bc72a7e6cb880a67.zip |
Fix small RTL layout bug in Search component
-rw-r--r-- | .changeset/sour-beans-cry.md | 5 | ||||
-rw-r--r-- | packages/starlight/components/Search.astro | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/.changeset/sour-beans-cry.md b/.changeset/sour-beans-cry.md new file mode 100644 index 00000000..33e807eb --- /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 6e58b46d..08684d04 100644 --- a/packages/starlight/components/Search.astro +++ b/packages/starlight/components/Search.astro @@ -34,7 +34,7 @@ const t = useTranslations(Astro.props.locale); </button> { import.meta.env.DEV ? ( - <div style="margin: auto; text-align: center;"> + <div style="margin: auto; text-align: center;" dir="ltr"> <p>Search is only available in production builds.</p> <p>Try building and previewing the site to test it out locally.</p> </div> @@ -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) => { |