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

Custom Input bug when using 2 at the same time #200

Closed
alireza0sfr opened this issue Nov 29, 2021 · 1 comment
Closed

Custom Input bug when using 2 at the same time #200

alireza0sfr opened this issue Nov 29, 2021 · 1 comment

Comments

@alireza0sfr
Copy link

alireza0sfr commented Nov 29, 2021

Hey
in a vue 2 project, I created a date component from your package and used custom-input prop, and when I wanted to use 2 date pickers on the same page 2 popups were rendered by clicking on each picker and the second picker date didnt work

PS: this happened on both editable and non editable mode

Live Example: https://codesandbox.io/s/lucid-keldysh-fybwt?file=/src/App.vue

@talkhabi
Copy link
Owner

Hi @alireza0sfr
Bug fixed; but you must provide a specific query selector for each component.
See this example:

<template>
  <div>
    <input type="text" :class="inputClass" />
    <DatePicker v-model="localData.selectedDate" popover :custom-input="`.${inputClass}`" />
  </div>
</template>

<script>
import DatePicker from 'vue-persian-datetime-picker'
export default {
  components: {
    DatePicker,
  },
  data() {
    return {
      localData: {
        selectedDate: '',
      },
    }
  },
  computed: {
    inputClass() {
      return `nikan-datetime-input-${this._uid}`
    },
  },
}
</script>

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