Skip to content

Commit fd76681

Browse files
authored
Merge pull request #428 from easyops-cn/steve/rtl
fix: manually make the search bar be LTR even if in RTL
2 parents 7f58aa2 + a5c7184 commit fd76681

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

docusaurus-search-local/src/client/theme/SearchBar/SearchBar.module.css

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,26 @@ html[data-theme="dark"] .noResultsIcon {
250250
}
251251
}
252252

253+
/* Manually make the search bar be LTR even if in RTL */
254+
html[dir="rtl"] .searchHintContainer {
255+
right: auto;
256+
left: 10px;
257+
}
258+
259+
html[dir="rtl"] .searchBarContainer .searchClearButton {
260+
right: auto;
261+
left: 0.8rem;
262+
}
263+
264+
html[dir="rtl"] .searchBarContainer .searchBarLoadingRing {
265+
left: auto;
266+
right: 10px;
267+
}
268+
269+
html[dir="rtl"] :global(.navbar__search-input) {
270+
padding: 0 2.25em 0 0.5em;
271+
}
272+
253273
/* For autocomplete.js only. */
254274
.input {
255275
}

docusaurus-search-local/src/client/theme/SearchBar/SearchBar.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,8 @@ export default function SearchBar({
425425
[styles.focused]: focused,
426426
})}
427427
hidden={hidden}
428+
// Manually make the search bar be LTR even if in RTL
429+
dir="ltr"
428430
>
429431
<input
430432
placeholder={translate({

0 commit comments

Comments
 (0)