-
-
Notifications
You must be signed in to change notification settings - Fork 247
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
Handle custom fonts loading #362
Handle custom fonts loading #362
Conversation
🦋 Changeset detectedLatest commit: 93acf2e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
bbbc78d
to
f0ef52e
Compare
Thanks @Andarist for the review. I tried using the code you provided but it isn't valid in the project's TS version ( Switching TS version in the TS playground link you provided reveals it: It works if you select TS 4.4+ and forward. Should we bump needed TS version or change the code somehow? The latest commit I pushed should break CI as I commited with disabled hooks. |
I think that it's fine to bump the TS version used by the repository. It won't actually have any effect on public consumers as those particular types are only relevant internally. |
@Andarist I upgraded the dev dependencies, eslint, babel and prettier along TS to make the whole setup work. |
It seems that Babel is not happy about this syntax (CI failed) - I think that it should handle this by now though. Could you recheck what is happening? |
Damn, I will. |
@Andarist I'm not to happy with the shenanigans I had to go through to get the tests pass: adding JSDom + mocking the listeners. It doesn't really hurt but it's not crazy elegant either. |
Hey @Andarist do you see any blockers for this PR? Happy to adjust |
We had an issue using this library with a custom font for the textarea. It turns out the initial resizing could be done before the font is loaded.
This PR brings both the fix for it and adds such a case in the examples.
The fix is rather simple: listen for fonts being loaded, the same way we listen for the window being resized, and resize when it is done.