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

fix(attributes): text-wrap takes external CSS into account #2542

Merged
merged 1 commit into from
Feb 19, 2024

Conversation

kumilingus
Copy link
Contributor

Description

The text-wrap attribute takes external CSS and inherited styles into account when computing the line breaks (previously only explicit inline attributes were considered).

The text-wrap worked properly only when the font attributes were set explicitly.

<text font-size="12">A text to wrap</text>

This PR adds support for external CSS:

<style>
  text { font-size: 12px; }
</style>

...

<text>A text to wrap</text>

Note: Thanks to #2459, all font attributes are evaluated and set before text-wrap, so it is safe to use the getComputedStyle() method.

Fixes #2295.

@MartinKanera MartinKanera merged commit 920da5a into clientIO:master Feb 19, 2024
3 checks passed
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

Successfully merging this pull request may close these issues.

[Bug]: textWrap is not calculating properly text size when using custom fonts / size (Bootstrap repro)
2 participants