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

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

Open
Justin-ZS opened this issue Jan 21, 2025 · 2 comments
Open

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

Justin-ZS opened this issue Jan 21, 2025 · 2 comments
Labels
bug en This issue is in English pending We are not sure about whether this is a bug/new feature.

Comments

@Justin-ZS
Copy link

Justin-ZS commented Jan 21, 2025

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

@Justin-ZS Justin-ZS added the bug label Jan 21, 2025
@echarts-bot echarts-bot bot added en This issue is in English pending We are not sure about whether this is a bug/new feature. labels Jan 21, 2025
@helgasoft
Copy link

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

@Justin-ZS
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug en This issue is in English pending We are not sure about whether this is a bug/new feature.
Projects
None yet
Development

No branches or pull requests

2 participants