vuetifyjs / vuetify

🐉 Vue Component Framework
https://vuetifyjs.com
MIT License
39.89k stars 6.97k forks source link

[Feature Request] Prevent VSelect automatic scrolling to the selected item #20237

Open emreseyit opened 3 months ago

emreseyit commented 3 months ago

Problem to solve

VSelect opens without scrolling to the selected item and also shows it as an option.

Proposed solution

Add a prop to disable auto scrolling. It can be named disable-auto-scroll and be false as default. The code line that prop going to added to.

I have a demo here. Code is like below:

<template>
  <v-app>
    <v-container>
      <v-select v-model="selected" :items="items" />
      <!-- Proposed solution -->
      <!-- <v-select v-model="selected" :items="items" :auto-scroll="false"/> -->
    </v-container>
  </v-app>
</template>

<script setup>,
  import { ref } from 'vue'

  const selected = ref('item5')
  const items = Array.from({ length: 21 }, (_, i) => 'item' + i.toString())

</script>
KaelWD commented 3 months ago

Why?

emreseyit commented 3 months ago

It's affecting UX and this feature was not available in the migrated project from Vue 2 to Vue 3. Customers are annoyed by this feature and I had to write a patch to remove it.

dawid-polak commented 3 months ago

I have a similar problem. With a long multiple list, after each selection of an item I get an automatic scroll to the first selected item. I added your parameter (auto-scroll), but this parameter did not change anything. Do you have any ideas?

canbax commented 3 days ago

we also suffer from the same "unwanted feature". Why auto-scroll to the selected? Users want to see the whole list. And if the value is hidden on the top, then the user immediately thinks that that value doesn't exist.