Skip to content

Commit

Permalink
fix: Remove focus effect on link to repository
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-santosP committed May 17, 2021
1 parent c2ac99d commit c77a8ea
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/components/LinkToRepository.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<template>
<a
ref="linkRef"
href="https://github.com/lucas-santosP/calculator"
target="_blank"
title="Go to the reposity"
title="Go to the repository"
class="absolute w-6 -top-9 left-2 transition-all hover:text-white"
>
<svg role="img" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
Expand All @@ -14,9 +15,23 @@
</template>

<script lang="ts">
import { defineComponent } from "vue";
import { defineComponent, onMounted, onUnmounted, ref } from "vue";
export default defineComponent({
name: "LinkToRepository",
setup: () => {
const linkRef = ref<HTMLLinkElement | null>(null);
const removeFocus = () => linkRef.value?.blur();
onMounted(() => {
linkRef.value?.addEventListener("click", removeFocus);
});
onUnmounted(() => {
linkRef.value?.removeEventListener("click", removeFocus);
});
return { linkRef };
},
});
</script>

0 comments on commit c77a8ea

Please sign in to comment.