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

Pass correct context to replaced element #886

Merged
merged 1 commit into from
Nov 26, 2021

Conversation

zbarbuto
Copy link
Contributor

@zbarbuto zbarbuto commented Nov 8, 2021

All other element renderers are passed newContext as their RenderContext - the context which has the appropriate styles for the element applied. However, ReplacedElement seemed to miss this change, meaning things like img tags did not get custom styles.

For example, without this change, an element like this:

      <img style="border: 4px solid teal;" src="https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png">

With an appropriate Container wrapping the network image:

Container(
  border: context.style.border,
  child: image,
);

Would render as:
image

With this change it can be rendered as expected:

image

@erickok
Copy link
Collaborator

erickok commented Nov 8, 2021

LGTM but I want to regression-test it before merging.

@erickok erickok merged commit a6acfbe into Sub6Resources:master Nov 26, 2021
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.

2 participants