Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(VField): make loader visible #18169

Merged
merged 4 commits into from Aug 30, 2023
Merged

fix(VField): make loader visible #18169

merged 4 commits into from Aug 30, 2023

Conversation

yuwu9145
Copy link
Member

@yuwu9145 yuwu9145 commented Aug 29, 2023

fixes #18146

Approach in v2:

image

Description

Markup:

<template>
  <v-app>
    <v-container>
      <v-autocomplete
        v-model:search.trim="modelSearch"
        placeholder="good"
        :loading="loading"
        hide-no-data
      />
      <v-autocomplete
        v-model:search.trim="modelSearch"
        placeholder="bad"
        :loading="true"
        hide-no-data
        variant="outlined"
      />
      <v-text-field
        v-model:search.trim="modelSearch"
        placeholder="bad"
        :loading="true"
        hide-no-data
        variant="outlined"
      />
      <v-autocomplete
        class="fixed"
        placeholder="fixed"
        v-model:search.trim="modelSearch"
        :loading="loading"
        hide-no-data
        variant="outlined"
      />
    </v-container>
  </v-app>
</template>

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

  const model = ref()

  const modelSearch = ref('')
  const loading = ref(false)
  const items = ref([])

  watch(modelSearch, async () => {
    loading.value = true
    await new Promise(resolve => setTimeout(resolve, 2000))
    loading.value = false
  })
</script>
<style>
  .fixed .v-field--variant-outlined.v-field--focused .v-field__loader {
    z-index: 1;
  }
  .fixed
    .v-field--variant-outlined.v-field--focused
    .v-field__loader
    .v-progress-linear__indeterminate {
    background-color: rgb(var(--v-theme-on-primary), 0.75) !important;
  }
</style>

@yuwu9145 yuwu9145 changed the title fix(VField): move loader down outside 1px of container fix(VField): make loader visible Aug 29, 2023
@johnleider johnleider added T: bug Functionality that does not work as intended/expected C: VField labels Aug 29, 2023
@johnleider johnleider added this to the v3.3.x milestone Aug 29, 2023
@johnleider
Copy link
Member

I made 2 tweaks. The loader is 2px in height so it needs to move further top by 1px. I also opted for overflow: hidden because with higher border radiuses, the loader looks terrible:

image

vs

image

@yuwu9145
Copy link
Member Author

yuwu9145 commented Aug 30, 2023

It still has issue of loading bar is hidden when outlined variant is focused. So:

  • The loader should be moved down by 1px in order to be always 1px visible outside
  • For higher border radiuses, $field-control-outlined-start-width could be used to prevent loader bar extends to radius area

@johnleider if you think this is the right approach, I'm happy to make it happen during next commit

text-field-loader

@KaelWD
Copy link
Member

KaelWD commented Aug 30, 2023

You can just make it thicker or shift it up another px when focused.

johnleider
johnleider previously approved these changes Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VField T: bug Functionality that does not work as intended/expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug Report][3.3.14] VAutocomplete loader bar invisible for focused outlined field
3 participants