You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "kianfang (via GitHub)" <gi...@apache.org> on 2023/02/20 09:57:25 UTC

[GitHub] [echarts] kianfang opened a new pull request, #18287: fix: an error may be reported when react uses tooltip to obtain width…

kianfang opened a new pull request, #18287:
URL: https://github.com/apache/echarts/pull/18287

   … and height
   
   <!-- Please fill in the following information to help us review your PR more efficiently. -->
   
   ## Brief Information
   
   This pull request is in the type of:
   
   - [ ] bug fixing
   - [ ] new feature
   - [ ] others
   
   
   
   ### What does this PR do?
   
   <!-- USE ONE SENTENCE TO DESCRIBE WHAT THIS PR DOES. -->
   
   
   
   ### Fixed issues
   
   <!--
   - #xxxx: ...
   -->
   
   
   ## Details
   
   ### Before: What was the problem?
   
   <!-- DESCRIBE THE BUG OR REQUIREMENT HERE. -->
   
   <!-- ADD SCREENSHOT HERE IF APPLICABLE. -->
   
   
   
   ### After: How does it behave after the fixing?
   
   <!-- THE RESULT AFTER FIXING AND A SIMPLE EXPLANATION ABOUT HOW IT IS FIXED. -->
   
   <!-- ADD SCREENSHOT HERE IF APPLICABLE. -->
   
   
   
   ## Document Info
   
   One of the following should be checked.
   
   - [ ] This PR doesn't relate to document changes
   - [ ] The document should be updated later
   - [ ] The document changes have been made in apache/echarts-doc#xxx
   
   
   
   ## Misc
   
   ### ZRender Changes
   
   - [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx).
   
   ### Related test cases or examples to use the new APIs
   
   N.A.
   
   
   
   ## 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] plainheart commented on a diff in pull request #18287: fix: an error may be reported when react uses tooltip to obtain width…

Posted by "plainheart (via GitHub)" <gi...@apache.org>.
plainheart commented on code in PR #18287:
URL: https://github.com/apache/echarts/pull/18287#discussion_r1112076009


##########
src/component/tooltip/TooltipView.ts:
##########
@@ -882,8 +882,15 @@ class TooltipView extends ComponentView {
         params: TooltipCallbackDataParams | TooltipCallbackDataParams[],
         el?: Element
     ) {
-        const viewWidth = this._api.getWidth();
-        const viewHeight = this._api.getHeight();
+        let viewWidth: number;
+        let viewHeight: number;
+        try {
+            viewWidth = this._api.getWidth();
+            viewHeight = this._api.getHeight();
+        } catch {
+            console.warn('tooltip width or height not obtained.');
+            return;
+        }

Review Comment:
   Thanks for your contribution!
   I think this is related to your code rather than ECharts itself. Please check why it's undefined in your project.
   If you persist it's a bug, please provide a reproducible demo for us to confirm. Thank you again. :)



-- 
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 #18287: fix: an error may be reported when react uses tooltip to obtain width…

Posted by "echarts-bot[bot] (via GitHub)" <gi...@apache.org>.
echarts-bot[bot] commented on PR #18287:
URL: https://github.com/apache/echarts/pull/18287#issuecomment-1436662014

   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).
   
   ⚠️ MISSING DOCUMENT INFO: Please make sure one of the document options are checked in this PR's description. Search "Document Info" in the description of this PR. This should be done either by the author or the reviewers of the PR.


-- 
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] kianfang commented on pull request #18287: fix: an error may be reported when react uses tooltip to obtain width…

Posted by "kianfang (via GitHub)" <gi...@apache.org>.
kianfang commented on PR #18287:
URL: https://github.com/apache/echarts/pull/18287#issuecomment-1436664807

   <img width="483" alt="image" src="https://user-images.githubusercontent.com/16569491/220073357-3afee0c2-faf0-4eaf-9dc3-08a8d2cf28a3.png">
   


-- 
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] kianfang closed pull request #18287: fix: an error may be reported when react uses tooltip to obtain width…

Posted by "kianfang (via GitHub)" <gi...@apache.org>.
kianfang closed pull request #18287: fix: an error may be reported when react uses tooltip to obtain width…
URL: https://github.com/apache/echarts/pull/18287


-- 
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