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

Datepicker start and end caught simultaneously when inside carousel #3720

Closed
bittorala opened this issue Apr 6, 2022 · 4 comments
Closed

Comments

@bittorala
Copy link

Overview of the problem

Buefy version 0.9.19
Vue version 2.6.11

Description

Sometimes when using a datepicker inside a carousel, with the datepicker in range mode, a single click can fire both the range-start and range-end event, thus selecting a one-day interval with a single click, instead of starting the range. Below is an example.

Steps to reproduce

Start selecting intervals, and at some point the range start will also be detected as range end with a single click.

<template>
  <div>
    <b-carousel :autoplay="false">
      <b-carousel-item v-for="i in [1, 2, 3]" :key="i" >
        <div id="mycontainer">
          <b-datepicker style="margin: auto" v-model="dates" range inline />
          <span>{{dates[0]}} - {{dates[1] }}</span>
        </div>
      </b-carousel-item>
    </b-carousel>
  </div>
</template>

<script lang="ts">
import { Component, Vue } from "vue-property-decorator";

@Component
export default class App extends Vue {
  private dates: Date[] = [new Date('2022-03-01'), new Date()];
}
</script>

<style>
#mycontainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #04f2a0;
  height: 99vh;
  width: 100vw;
  overflow-y: hidden;
}
</style>

Expected behaviour

When an interval is already selected and we make one click outside of it, we expect to have either a new interval with the furthest of the old ends and the clicked end, or to start a new range which has the clicked date as one end, but needs to be closed with another click.

Actual behaviour

A range is created which starts AND ends on the clicked date.

@stale
Copy link

stale bot commented Nov 12, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 12, 2022
@rivaldi8
Copy link

As a workaround, adding :has-drag="false" to b-carousel, makes the picker work properly again.

@stale stale bot removed the stale label Dec 15, 2022
@stale
Copy link

stale bot commented Jun 18, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 18, 2023
@wesdevpro
Copy link
Member

As a workaround, adding :has-drag="false" to b-carousel, makes the picker work properly again.

Closing because a workaround was found! If anyone finds this to be an issue please reopen this issue. Thank You!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Completed ✅
Development

No branches or pull requests

3 participants