Skip to content

Commit

Permalink
fix: resolve first search result missing nav bg color on prod
Browse files Browse the repository at this point in the history
  • Loading branch information
tmthyadms committed Nov 21, 2023
1 parent 38c2058 commit f355d58
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions components/search-menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default {
this.$nextTick(() => {
const firstSearchItem =
document.getElementById("search-item-0").firstChild;
firstSearchItem.classList.add("focus");
firstSearchItem.classList.add("menu-focus");
window.addEventListener(
"keydown",
(event) => {
Expand All @@ -60,8 +60,8 @@ export default {
if (document.getElementById("search-item-0")) {
const firstSearchItem =
document.getElementById("search-item-0").firstChild;
if (firstSearchItem.classList.contains("focus"))
firstSearchItem.classList.remove("focus");
if (firstSearchItem.classList.contains("menu-focus"))
firstSearchItem.classList.remove("menu-focus");
}
if (event.code === "ArrowDown") {
event.preventDefault();
Expand All @@ -82,3 +82,9 @@ export default {
},
};
</script>

<style scoped>
.menu-focus {
@apply bg-base-content/[0.1];
}
</style>

0 comments on commit f355d58

Please sign in to comment.