Skip to content

marker-tooltip slot returns single object instead of array #959

Closed
@xSimekj1

Description

@xSimekj1

Describe the bug

When customizing tooltips via #marker-tooltip slot, there are two props available: tooltip and day. The issue is that tooltip is not an array as expected but is provided one by one. So, instead of Tooltip[], we get just Tooltip, causing TypeScript to report errors when trying to work with the data.
This issue does not occur in the #marker slot.

Steps to reproduce the behavior:

  1. Recreate https://vue3datepicker.com/slots/content/#marker-tooltip example
  2. Try to use #marker-tooltip slot with tooltip data and check tooltip isArray
  3. Alternatively, check the StackBlitz example: https://stackblitz.com/edit/vuepic-vue-datepicker-mwn8fd?file=src%2Fcomponents%2FPlayground.vue

Expected behavior

Either the return type of slot should be just a single Tooltip object or it should return an array Tooltip[] as TypeScript expects.
According to docs it should be also array tooltip - The tooltip data provided in the array

Screenshots

Typescript expects array of tooltips
Typescript expects array of Tooltips

image
Single Tooltip returned instead

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions