Skip to content

tooltip position callback return types not correct #15030

@congjiujiu

Description

@congjiujiu

Version

5.1.1

Steps to reproduce

option = {
  tooltip: {
    position: (pos) => [pos[0], '12px']
  }
}

What is expected?

the return type of TooltipPositionCallback needs to be Array<number | string> but number[] | string[]

What is actually happening?

typecheck fails because the return type not correct


ts errors:

(property) tooltip?: Arrayable<TooltipOption> | undefined
Type '{ trigger: "axis"; enterable: true; position: (pos: [number, number]) => (string | number)[]; }' is not assignable to type 'Arrayable<TooltipOption> | undefined'.
  Type '{ trigger: "axis"; enterable: true; position: (pos: [number, number]) => (string | number)[]; }' is not assignable to type 'undefined'.ts(2322)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugenThis issue is in EnglishpendingWe are not sure about whether this is a bug/new feature.waiting-for: community

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions