镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

[Bug] Changing tooltip config doesn't refresh the displayed tooltip #20706

Closed

Description

@Justin-ZS

Version

5.6.0

Link to Minimal Reproduction

  1. copy the code from demo2 in into demo
  2. click one bar and you can see the axis tooltip
  3. press Ctrl and the tooltip is still the axis tooltip (NG)
  4. mousemove to see the item tooltip

Steps to Reproduce

I want to show different tooltip when thectrl key is pressed or not.

document.addEventListener('keydown', (e) => {
    if (e.ctrlKey) myChart.setOption({ tooltip: { trigger: 'item' } })
})
document.addEventListener('keyup', (e) => {
    myChart.setOption({ tooltip: { trigger: 'axis' } })
})

When I press the key, the tooltip is not refreshed until I move the mouse.
After I move the mouse and the new tooltip gets shown once, releasing/pressing the key can toggles the tooltip as expected.

Current Behavior

When I press the key, the tooltip is not refreshed until I move the mouse.

Expected Behavior

When I press the key, the tooltip should be refreshed.

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

Activity

  1. added
    enThis issue is in English
    pendingWe are not sure about whether this is a bug/new feature.
    on Jan 21, 2025
  2. helgasoft commented on Jan 22, 2025

    @helgasoft

    A chart can be controlled by keys, but first it needs focus, see #20646.

  3. Justin-ZS commented on Jan 22, 2025

    @Justin-ZS
    ContributorAuthor

    A chart can be controlled by keys, but first it needs focus, see #20646.

    Not the focus issue.
    The tooltip is triggered to update but stopped due to _updateContentNotChangedOnAxis

  4. removed
    pendingWe are not sure about whether this is a bug/new feature.
    on Nov 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugenThis issue is in English

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions