Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stop rotation of icons in the v-autocomplete component?

I am trying to use v-autocomplete for a search box. Since its a search box, I am changing the triangle to a search icon using [append-icon="search"]. Now the problem is the search icon rotates 180 and flips upside down. What is the solution to stop that from happening?

<v-autocomplete
   label="Search the collection"
   append-icon="search"
   :items ="components"
/>
like image 793
Shubham Pokharel Avatar asked Sep 06 '19 13:09

Shubham Pokharel


People also ask

How do I use the autocomplete component with objects?

The autocomplete component extends v-select and adds the ability to filter items. When using objects for the items prop, you must associate item-text and item-value with existing properties on your objects. These values are defaulted to text and value and can be changed. The auto property of menu-props is only supported for the default input style.

What happens when autocomplete is turned off?

If a site sets autocomplete="off" for username and password <input> fields, then the browser will still offer to remember this login, and if the user agrees, the browser will autofill those fields the next time the user visits the page.

How do I turn off auto-rotation on the Action Center?

The Action Center has a quick action tile that toggles auto-rotation on or off. To open it, click the notification icon on the taskbar at the bottom right corner of your screen, or press Windows+A.

How do I turn off auto rotation on Windows 10?

How to Toggle Rotation On or Off. The Action Center has a quick action tile that toggles auto-rotation on or off. To open it, click the notification icon on the taskbar at the bottom right corner of your screen, or press Windows+A. Click or tap the “Rotation Lock” tile at the bottom of the Action Center pane to enable Rotation Lock.


Video Answer


2 Answers

Vuetify applies a 180 degree rotation to appended icons of active v-select components

<style>
  .v-select.v-select--is-menu-active .v-input__icon--append .v-icon {
    transform: rotate(180deg);
  }
</style>

I was appending a search icon to my autocomplete component, but it would always turn upside-down when the menu opened. I solved it by simply overriding the above:

<style>
  .v-autocomplete.v-select--is-menu-active .v-input__icon--append .v-icon {
    transform: none;
  }
</style>

Of course, you might not want to override this for all selects. I would recommended you to be as specific as possible when overriding default styles.

like image 141
valentin Avatar answered Jan 03 '23 10:01

valentin


Well after some search the only solution i came up with is to remove the css class responsible for the rotation using javascript like this:

var transformClass = document.querySelector(".v-input__icon--append");
transformClass.classList.remove("v-input__icon--append");

here is an example

like image 23
xplo4d Avatar answered Jan 03 '23 10:01

xplo4d