[Vuejs]-Onclick action slower than css :focus selector switch

0👍

✅

I managed to solve the issue by applying the solution provided in this answer.

The reason why this didn’t work in the first place was, because .2s still are too fast, I had to change it to 0.3s

To conclude:

I changed css to this:

.result-span {
  transition: visibility .3s;
}

.search-field ~ .result-span {
  visibility: hidden;
}

.search-field:focus ~ .result-span, .search-field:active ~ .result-span {
  visibility: visible;
}

Leave a comment