Skip to content

Commit a5df4b7

Browse files
committed
Fix z-index issue in search modal and clean up template structure
1 parent cb7a41b commit a5df4b7

File tree

1 file changed

+24
-25
lines changed

1 file changed

+24
-25
lines changed

resources/views/_partials/_search.blade.php

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div x-data="searchConfig()" x-init="$watch('searchVisible', value => toggle())" x-show="searchVisible" x-cloak
22
class="fixed inset-0 z-50 overflow-y-auto p-4 sm:p-6 md:p-20" role="dialog" aria-modal="true">
3-
<div class="fixed inset-0 bg-gray-700 bg-opacity-50 transition-opacity" aria-hidden="true"></div>
3+
<div class="fixed inset-0 bg-gray-700 bg-opacity-50 transition-opacity -z-10" aria-hidden="true"></div>
44

55
<div @click.outside="searchVisible = false"
66
class="mx-auto max-w-xl transform overflow-hidden rounded-xl bg-white shadow-2xl ring-1 ring-black ring-opacity-5 transition-all">
@@ -36,8 +36,7 @@ class="border-t border-gray-100 py-14 px-6 text-center text-sm sm:px-14">
3636
x-show="searchQuery.length && (threads.total || articles.total || users.total)"
3737
x-data="tabConfig()"
3838
x-init="$watch('activeTab', value => setActiveTab(value))"
39-
x-cloak
40-
>
39+
x-cloak>
4140
<ul class="grid grid-flow-col text-center text-gray-500 bg-gray-100 rounded-lg p-1">
4241
<li>
4342
<a href="javascript:void(0)" @click="activeTab = 'threads'" class="flex justify-center py-4" :class="currentTab('threads')">
@@ -61,33 +60,33 @@ class="border-t border-gray-100 py-14 px-6 text-center text-sm sm:px-14">
6160
<ul>
6261
<li x-show="activeTab === 'threads'" class="mt-2 text-sm text-gray-800">
6362
<template x-for="thread in threads.threads">
64-
<li class="cursor-default select-none px-4 py-2 hover:bg-lio-100" :id="`option-${thread.id}`" role="option" tabindex="-1">
65-
<a :href="'/forum/'+thread.slug" class="flex flex-col">
66-
<span class="text-black-900 font-medium break-all" x-html="thread._highlightResult.subject.value"></span>
67-
<span class="text-black-900 break-all" x-html="thread._snippetResult.body.value"></span>
68-
</a>
69-
</li>
70-
</template>
63+
<li class="cursor-default select-none px-4 py-2 hover:bg-lio-100" :id="`option-${thread.id}`" role="option" tabindex="-1">
64+
<a :href="'/forum/'+thread.slug" class="flex flex-col">
65+
<span class="text-black-900 font-medium break-all" x-html="thread._highlightResult.subject.value"></span>
66+
<span class="text-black-900 break-all" x-html="thread._snippetResult.body.value"></span>
67+
</a>
68+
</li>
69+
</template>
7170
</li>
7271
<li x-show="activeTab === 'articles'" class="mt-2 text-sm text-gray-800">
7372
<template x-for="article in articles.articles">
74-
<li class="cursor-default select-none px-4 py-2 hover:bg-lio-100" :id="`option-${article.id}`" role="option" tabindex="-1">
75-
<a :href="'/articles/'+article.slug" class="flex flex-col">
76-
<span class="text-black-900 font-medium break-all" x-html="article._highlightResult.title.value"></span>
77-
<span class="text-black-900 break-all" x-html="article._snippetResult.body.value"></span>
78-
</a>
79-
</li>
80-
</template>
73+
<li class="cursor-default select-none px-4 py-2 hover:bg-lio-100" :id="`option-${article.id}`" role="option" tabindex="-1">
74+
<a :href="'/articles/'+article.slug" class="flex flex-col">
75+
<span class="text-black-900 font-medium break-all" x-html="article._highlightResult.title.value"></span>
76+
<span class="text-black-900 break-all" x-html="article._snippetResult.body.value"></span>
77+
</a>
78+
</li>
79+
</template>
8180
</li>
8281
<li x-show="activeTab === 'users'" class="mt-2 text-sm text-gray-800">
8382
<template x-for="user in users.users">
84-
<li class="cursor-default select-none px-4 py-2 hover:bg-lio-100" :id="`option-${user.id}`" role="option" tabindex="-1">
85-
<a :href="'/user/'+user.username" class="flex flex-col">
86-
<span class="text-black-900 font-medium break-all" x-html="user._highlightResult.username.value"></span>
87-
<span class="text-black-900 break-all" x-html="user._highlightResult.name.value"></span>
88-
</a>
89-
</li>
90-
</template>
83+
<li class="cursor-default select-none px-4 py-2 hover:bg-lio-100" :id="`option-${user.id}`" role="option" tabindex="-1">
84+
<a :href="'/user/'+user.username" class="flex flex-col">
85+
<span class="text-black-900 font-medium break-all" x-html="user._highlightResult.username.value"></span>
86+
<span class="text-black-900 break-all" x-html="user._highlightResult.name.value"></span>
87+
</a>
88+
</li>
89+
</template>
9190
</li>
9291
</ul>
9392
</div>
@@ -109,4 +108,4 @@ class="border-t border-gray-100 py-14 px-6 text-center text-sm sm:px-14">
109108
</a>
110109
</div>
111110
</div>
112-
</div>
111+
</div>

0 commit comments

Comments
 (0)