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 2021/05/13 15:18:42 UTC

[GitHub] [echarts] bryanmillerph commented on issue #10478: "Can't get dom width or height" incorrectly fires for width/height values of 0.

bryanmillerph commented on issue #10478:
URL: https://github.com/apache/echarts/issues/10478#issuecomment-840632694


   > > ### Version
   > > 4.2.1
   > > ### Steps to reproduce
   > > This warning from echarts: https://github.com/apache/incubator-echarts/blob/b6ab21159617b45c8077d998d468977cdd87d146/src/echarts.js#L1999 seems to be triggered when `!dom.clientWidth`, however I believe it is valid for `dom.clientWidth` to have a value of `0`.
   > > I'm not sure why this warning was added, but I think the check should be `dom.clientWidth === undefined` if the check is for a failure of the `clientWidth` API to exist.
   > > ### What is expected?
   > > warning should not occur for element width/height of 0
   > > ### What is actually happening?
   > > warning is logged.
   > > I'm happy to resolve this issue, but I'd like some confirmation my hunch is correct, or a clarification for why it is not.
   > 
   > I got this warning because I using tab card, when page onload the container set by CSS with `display:none` . So I got this warning, but when switch the tab card, container will be assigned the width/height instead of 0. So for me just ignored this warn.
   
   echarts-5.1.1:
   I was also getting this issue when a <div> containing the chart is initially set to display:none; 


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

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