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

crash in react-textfit when resizing window #72

Open
chandde opened this issue Feb 23, 2021 · 0 comments
Open

crash in react-textfit when resizing window #72

chandde opened this issue Feb 23, 2021 · 0 comments

Comments

@chandde
Copy link

chandde commented Feb 23, 2021

here's the call stack,

KEGo.t.innerWidth (innerSize.js:16)
value (Textfit.js:136)
n.handleWindowResize (Textfit.js:77)
s (throttle.js:26)
setTimeout (async)
(anonymous) (throttle.js:36)

in below function, el is null. according to the code, this el is an intermediate div wrapper that's not from consumer code but inside the library, is this something can be looked at?

I have a very good chance to reproduce this issue when the page is refreshed (just loaded) then resize the window, after that it seems to be fine.

// Calculate width without padding.
function innerWidth(el) {
    var style = window.getComputedStyle(el, null);
    return el.clientWidth - parseInt(style.getPropertyValue('padding-left'), 10) - parseInt(style.getPropertyValue('padding-right'), 10);
}
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

1 participant