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"
/>
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.
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.
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 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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With