nuxt-community / vuetify-module

Vuetify Module for Nuxt 2
Other
629 stars 106 forks source link

Current date in datepicker does not display when a new date is selected #302

Open simeon9696 opened 4 years ago

simeon9696 commented 4 years ago

Module version @nuxtjs/vuetify-v1.11.0

Describe the bug Datepicker shows the current date the first time it's loaded but as soon as I change the date the current date disappears. It re-appears if I click on the area where the current date is

To Reproduce I couldn't get the sandbox to load for some reason. My wifi is pretty unreliable at the moment. But this is the code that wraps the datepicker:

<template>
  <v-container fill-height>
    <v-layout justify-center align-center>
          <v-col cols="12" sm="6" md="4">
            <v-dialog
              ref="dialog"
              v-model="modal"
              :return-value.sync="date"
              persistent
              max-width="500"
            >
              <template v-slot:activator="{ on }">
                <v-text-field
                  v-model="date"
                  label="Month and year"
                  prepend-icon="mdi-calendar-edit"
                  readonly
                  v-on="on"
                >
                </v-text-field>
              </template>
              <v-date-picker v-model="date" scrollable
                :landscape="$vuetify.breakpoint.md"
                :full-width="true"
                min="2019-12-01"
              >
                <v-spacer></v-spacer>
                <v-btn text  color="primary" @click="modal = false">Cancel</v-btn>
                <v-btn text color="primary" @click="$refs.dialog.save(date)">OK</v-btn>
              </v-date-picker>
            </v-dialog>
          </v-col>
    </v-layout>
  </v-container>
</template>

<script>
  data() {
    return {
      date: new Date().toISOString().substr(0, 10),
      menu: false,
      modal: false,
    }
  }
</script>

Expected behavior The current date stays visible on the datepicker when another date is selected

Screenshots Datepicker on first time load image

When I select another date (March 24th missing i.e. the current date) image

Additional context I did try upgrading to v2.0.0beta.0 but then my dark theme wouldn't show up despite the settings in the nuxt.config.js which is a separate issue altogether.

How do I get the current date to show when another date is selected?

simeon9696 commented 4 years ago

Setting :show-current='false' is a temporary workaround. You don't get to see the current date with the outline, but at least the current date doesn't disappear if you select another date

mwgamble commented 4 years ago

I'm pretty sure this is an issue with the default colour scheme when you select the dark theme. The current date uses the 'accent' colour, which is by default configured to a grey colour that isn't really meant to be used for text as far as I can tell (especially not when the text is on a dark background).

polymer-coder commented 3 years ago

I'm having the same issue on vuetify 2.4.3

polymer-coder commented 3 years ago

I discovered that if you set a color then it shows the current date properly image

JohnnyHowe commented 3 years ago

I'm having the same issue, with none of the above fixes working.

I reckon it's to do with the fact that a text field also has the same v-model. Removing the v-model from the text field makes it work.

But now how do I keep them bound together?

polymer-coder commented 3 years ago

@JohnnyHowe try value ?

<v-text-field
    :value="date"
    label="Month and year"
    prepend-icon="mdi-calendar-edit"
    readonly
    v-on="on"
  >
 </v-text-field>