Skip to content

Commit

Permalink
Fix small RTL layout bug in Search component
Browse files Browse the repository at this point in the history
  • Loading branch information
delucis committed May 25, 2023
1 parent 8688778 commit 116c4f5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/sour-beans-cry.md
@@ -0,0 +1,5 @@
---
"@astrojs/starlight": patch
---

Fix minor dev layout bug in Search modal for RTL languages
8 changes: 6 additions & 2 deletions packages/starlight/components/Search.astro
Expand Up @@ -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>
Expand Down Expand Up @@ -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) => {
Expand Down

0 comments on commit 116c4f5

Please sign in to comment.