Fix z-index of search highlight (#3533)

This commit is contained in:
Zeno Kapitein
2025-08-05 14:08:46 +02:00
committed by GitHub
parent 9f0117723c
commit ba7ec14f76
2 changed files with 8 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"gitbook": patch
---
Fix bug in search highlight in GBO
@@ -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 (
<span className={tcls('whitespace-break-spaces')}>
<span className={tcls('relative z-2 whitespace-break-spaces')}>
{matches.map((entry, index) => (
<span key={index} className={tcls(entry.match ? highlight : null)}>
{entry.text}