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

Infinite loop when parent offsetWidth is invalid #77

Closed
gpfunk opened this issue Nov 20, 2017 · 0 comments
Closed

Infinite loop when parent offsetWidth is invalid #77

gpfunk opened this issue Nov 20, 2017 · 0 comments

Comments

@gpfunk
Copy link
Contributor

gpfunk commented Nov 20, 2017

Expected Behaviour

The code to gracefully handle invalid parent offsetWidth

Actual Behaviour

The code ends up infinitely looping looking for a valid number

Steps to Reproduce:

<div id="chart-composite-1" class="border" style="width: 0;"><svg height=225></svg></div>

Frappé Charts version: Tested on latest, but existed prior as well

This is an extreme example (explicitly setting a width to 0), but its just an illustration for when a parent offsetWidth is invalid (<= 0). Not sure if this should be handled by the lib though, or whether the user should be required to making sure the container is setup correctly.

A fix that I'm using is switching:

if(this.is_series) {

to:

if(this.is_series && allowed_space > 0) {

@gpfunk gpfunk changed the title Infinite loop when no parent width is present Infinite loop when parent offsetWidth is invalid Nov 20, 2017
@pratu16x7 pratu16x7 mentioned this issue Apr 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants