Skip to content

Commit ba7ec14

Browse files
authored
Fix z-index of search highlight (#3533)
1 parent 9f01177 commit ba7ec14

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.changeset/spicy-baboons-buy.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"gitbook": patch
3+
---
4+
5+
Fix bug in search highlight in GBO

packages/gitbook/src/components/Search/HighlightQuery.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ export function HighlightQuery(props: {
1515
query,
1616
text,
1717
highlight = [
18+
'-z-1',
19+
'relative',
1820
'text-bold',
1921
'bg-primary',
2022
'text-contrast-primary',
@@ -33,7 +35,7 @@ export function HighlightQuery(props: {
3335
const matches = matchString(text, query);
3436

3537
return (
36-
<span className={tcls('whitespace-break-spaces')}>
38+
<span className={tcls('relative z-2 whitespace-break-spaces')}>
3739
{matches.map((entry, index) => (
3840
<span key={index} className={tcls(entry.match ? highlight : null)}>
3941
{entry.text}

0 commit comments

Comments
 (0)