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

No way to prevent closing calendar in popover mode on selection #895

Closed
tokidoki11 opened this issue May 25, 2021 · 2 comments
Closed

No way to prevent closing calendar in popover mode on selection #895

tokidoki11 opened this issue May 25, 2021 · 2 comments

Comments

@tokidoki11
Copy link

Currently I'm using calendar that can be called by clicking a button

    <v-date-picker
      ref="datepicker"
      v-model="dateRange"
      :popover="{ visibility: 'click' }"
      :columns="2"
      is-range
      :max-date="new Date()"
      @popoverWillHide="willHide"
      @input="itemUpdated"
    >
      <template v-slot="{inputValue ,inputEvents}">
        <el-button round
          v-on="inputEvents.start"
        >
          {{
            inputValue.start && inputValue.end ?
              `${inputValue.start}~${inputValue.end}`: ' add time'
          }}
        </el-button>
      </template>
      <template v-slot:footer>
        <div class="calendar-footer">
          <el-row>
            <el-col :span="8">
              <el-button type="text"
                @click="clearSelectedDate"
                :disabled="!dateRange"
              >
                clear
              </el-button>
            </el-col>
            <el-col class="right" :span="16">
              <el-button @click="clearDatepicker" type="text">
                cancel
              </el-button>
              <el-button type="primary" round>
                save
              </el-button>
            </el-col>
          </el-row>
        </div>
      </template>
</v-calendar>

My requirement is to set the date if and only if the client set save button in the footer.
But currently selecting the date it will close the popover and automatically set the date

I would like to prevent the event from happening
but the parameter sent by input or popoverWillHide event is not sufficient to do this

forcing this.$refs.datepicker.showPopover on input event is quite hacky and it somehow feels jumpy
and sometimes dont work

@tokidoki11
Copy link
Author

My bad it seems can be handled by this

#118

@amanayon
Copy link

The solution on #118 seem to be outdated.
I'm using slot contents by the way.
Is there a new way to prevent the calendar from auto hiding after selecting a date?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants