From ba7ec14f764ce250652ff1ec1c216be24e3e8514 Mon Sep 17 00:00:00 2001 From: Zeno Kapitein Date: Tue, 5 Aug 2025 14:08:46 +0200 Subject: [PATCH] Fix z-index of search highlight (#3533) --- .changeset/spicy-baboons-buy.md | 5 +++++ packages/gitbook/src/components/Search/HighlightQuery.tsx | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/spicy-baboons-buy.md diff --git a/.changeset/spicy-baboons-buy.md b/.changeset/spicy-baboons-buy.md new file mode 100644 index 000000000..7ea226886 --- /dev/null +++ b/.changeset/spicy-baboons-buy.md @@ -0,0 +1,5 @@ +--- +"gitbook": patch +--- + +Fix bug in search highlight in GBO diff --git a/packages/gitbook/src/components/Search/HighlightQuery.tsx b/packages/gitbook/src/components/Search/HighlightQuery.tsx index c54796a7c..794d16f7d 100644 --- a/packages/gitbook/src/components/Search/HighlightQuery.tsx +++ b/packages/gitbook/src/components/Search/HighlightQuery.tsx @@ -15,6 +15,8 @@ export function HighlightQuery(props: { query, text, highlight = [ + '-z-1', + 'relative', 'text-bold', 'bg-primary', 'text-contrast-primary', @@ -33,7 +35,7 @@ export function HighlightQuery(props: { const matches = matchString(text, query); return ( - + {matches.map((entry, index) => ( {entry.text}