You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2022/01/08 10:50:17 UTC
[GitHub] [echarts] plainheart opened a new pull request #16347: fix(tooltip): fix the page will be frozen if multiple tooltips are provided.
plainheart opened a new pull request #16347:
URL: https://github.com/apache/echarts/pull/16347
## Brief Information
This pull request is in the type of:
- [x] bug fixing
- [ ] new feature
- [ ] others
### What does this PR do?
- Fix the bug that the page will be frozen if multiple tooltips are provided.
- Give a warning if it's in the development environment.
### Fixed issues
- #6722
- #9152
- #14850
- #16236
## Details
### Before: What was the problem?
As the _**Multiple Tooltip**_ doesn't get supported yet, the page will get frozen if more than one tooltip is provided.
### After: How is it fixed in this PR?
Check if there already exists a tooltip component and avoid creating another one to prevent the tooltip component from falling into an infinite loop that freezes the page.
## Misc
- [ ] The API has been changed (apache/echarts-doc#xxx).
- [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx).
### Related test cases or examples to use the new APIs
Please refer to `test/tooltip-multiple.html`
## Others
### Merging options
- [ ] Please squash the commits into a single one when merging.
### Other information
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [echarts] pissang commented on a change in pull request #16347: fix(tooltip): fix the page will be frozen if multiple tooltips are provided.
Posted by GitBox <gi...@apache.org>.
pissang commented on a change in pull request #16347:
URL: https://github.com/apache/echarts/pull/16347#discussion_r780672281
##########
File path: src/model/Global.ts
##########
@@ -431,6 +433,18 @@ echarts.use([${seriesImportName}]);`);
return;
}
+ // Before multiple tooltips get supported,
+ // we do this check to avoid unexpected exception.
Review comment:
We can add a `TODO` or `FIXME` mark here
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [echarts] pissang commented on pull request #16347: fix(tooltip): fix the page will be frozen if multiple tooltips are provided.
Posted by GitBox <gi...@apache.org>.
pissang commented on pull request #16347:
URL: https://github.com/apache/echarts/pull/16347#issuecomment-1008002950
> One question: Whether this warning should output only once?
I think it's reasonable to give a warn each time `setOption` is used.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [echarts] pissang merged pull request #16347: fix(tooltip): fix the page will be frozen if multiple tooltips are provided.
Posted by GitBox <gi...@apache.org>.
pissang merged pull request #16347:
URL: https://github.com/apache/echarts/pull/16347
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [echarts] plainheart commented on a change in pull request #16347: fix(tooltip): fix the page will be frozen if multiple tooltips are provided.
Posted by GitBox <gi...@apache.org>.
plainheart commented on a change in pull request #16347:
URL: https://github.com/apache/echarts/pull/16347#discussion_r780674582
##########
File path: src/model/Global.ts
##########
@@ -431,6 +433,18 @@ echarts.use([${seriesImportName}]);`);
return;
}
+ // Before multiple tooltips get supported,
+ // we do this check to avoid unexpected exception.
+ if (mainType === 'tooltip') {
+ if (tooltipExists) {
+ if (__DEV__) {
+ warn('Currently only one tooltip component is allowed.');
Review comment:
Here we should tweak slightly, or it will output the log as many times as **the count of tooltip option - 1**.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [echarts] pissang edited a comment on pull request #16347: fix(tooltip): fix the page will be frozen if multiple tooltips are provided.
Posted by GitBox <gi...@apache.org>.
pissang edited a comment on pull request #16347:
URL: https://github.com/apache/echarts/pull/16347#issuecomment-1008002950
> One question: Whether this warning should output only once?
I think it's reasonable and not too much to give a warn each time `setOption` is used.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [echarts] plainheart commented on a change in pull request #16347: fix(tooltip): fix the page will be frozen if multiple tooltips are provided.
Posted by GitBox <gi...@apache.org>.
plainheart commented on a change in pull request #16347:
URL: https://github.com/apache/echarts/pull/16347#discussion_r780676603
##########
File path: src/model/Global.ts
##########
@@ -431,6 +433,18 @@ echarts.use([${seriesImportName}]);`);
return;
}
+ // Before multiple tooltips get supported,
+ // we do this check to avoid unexpected exception.
+ if (mainType === 'tooltip') {
+ if (tooltipExists) {
+ if (__DEV__) {
+ warn('Currently only one tooltip component is allowed.');
Review comment:
@pissang Done. Now it only outputs the warning once when `setOption` is called, no matter how many tooltips are provided.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [echarts] plainheart commented on pull request #16347: fix(tooltip): fix the page will be frozen if multiple tooltips are provided.
Posted by GitBox <gi...@apache.org>.
plainheart commented on pull request #16347:
URL: https://github.com/apache/echarts/pull/16347#issuecomment-1007985405
One question: **_Whether this warning should output only once?_**
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [echarts] echarts-bot[bot] commented on pull request #16347: fix(tooltip): fix the page will be frozen if multiple tooltips are provided.
Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on pull request #16347:
URL: https://github.com/apache/echarts/pull/16347#issuecomment-1008032315
Congratulations! Your PR has been merged. Thanks for your contribution! 👍
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [echarts] echarts-bot[bot] commented on pull request #16347: fix(tooltip): fix the page will be frozen if multiple tooltips are provided.
Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on pull request #16347:
URL: https://github.com/apache/echarts/pull/16347#issuecomment-1007953761
Thanks for your contribution!
The community will review it ASAP. In the meanwhile, please checkout [the coding standard](https://echarts.apache.org/en/coding-standard.html) and Wiki about [How to make a pull request](https://github.com/apache/echarts/wiki/How-to-make-a-pull-request).
The pull request is marked to be `PR: author is committer` because you are a committer of this project.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [echarts] plainheart commented on a change in pull request #16347: fix(tooltip): fix the page will be frozen if multiple tooltips are provided.
Posted by GitBox <gi...@apache.org>.
plainheart commented on a change in pull request #16347:
URL: https://github.com/apache/echarts/pull/16347#discussion_r780674582
##########
File path: src/model/Global.ts
##########
@@ -431,6 +433,18 @@ echarts.use([${seriesImportName}]);`);
return;
}
+ // Before multiple tooltips get supported,
+ // we do this check to avoid unexpected exception.
+ if (mainType === 'tooltip') {
+ if (tooltipExists) {
+ if (__DEV__) {
+ warn('Currently only one tooltip component is allowed.');
Review comment:
Here we should tweak slightly, or it will output the log as many times as **the count of tooltip option - 1**. Doing it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org