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: toggleCallback missing on dropdownbutton slot #6543

Closed
walnutjon opened this issue Oct 8, 2024 · 0 comments · Fixed by #6548
Closed

DatePicker: toggleCallback missing on dropdownbutton slot #6543

walnutjon opened this issue Oct 8, 2024 · 0 comments · Fixed by #6548
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@walnutjon
Copy link

Describe the bug

I think that toggleCallback is missing on the dropdownbutton slot for DatePicker, so there is no way to trigger the opening of the calendar when using a custom button.

If I output slotProps from within the template I just get: { key: 1 }

Looking at the code for DatePicker.vue 4.1.0, line 35 is:

<slot v-if="showIcon && iconDisplay === 'button' && !inline" name="dropdownbutton">

I believe this should look something like the following:

<slot v-if="showIcon && iconDisplay === 'button' && !inline" name="dropdownbutton" :toggleCallback='onButtonClick'>

(I don't know much about building these libraries, so I may be way off base on the cause here.)

Reproducer

https://stackblitz.com/edit/primevue-4-ts-vite-issue-template-qgmkpu?file=src%2FApp.vue

PrimeVue version

4.1.0

Vue version

3.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

Declare template, something like:

  <DatePicker v-model="testDate" showIcon iconDisplay="button" inputId="test">
    <template #dropdownbutton="slotProps">
      No toggleCallback on slotprops: {{ slotProps }}
    </template>
  </DatePicker>

Expected behavior

toggleCallback is available on the slot for dropdownbutton, I can call it and the calendar opens.

@walnutjon walnutjon added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Oct 8, 2024
mergehez added a commit to mergehez/primevue that referenced this issue Oct 9, 2024
mergehez added a commit to mergehez/primevue that referenced this issue Oct 9, 2024
tugcekucukoglu added a commit that referenced this issue Nov 1, 2024
@tugcekucukoglu tugcekucukoglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Nov 1, 2024
@tugcekucukoglu tugcekucukoglu added this to the 4.2.0 milestone Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants