Skip to content

Correctly apply react style object to the dom element renderer #2511

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

Merged
merged 2 commits into from
Jun 28, 2018

Conversation

paulkaplan
Copy link
Contributor

Resolves

What Github issue does this resolve (please include link)?

Proposed Changes

Describe what this Pull Request does

Use the to-style module to correctly translate the style object to a style string in the DOMElementRenderer.

Reason for Changes

Explain why these changes should be made

So that the width/height can be applied to the canvas as CSS, since the width/height attributes are managed by the renderer.

I also removed the shrink={0} property, since it isn't doing anything.

Test Coverage

Please show how you have added tests to cover your changes

Manually tested the issues linked above

Browser Coverage

Check the OS/browser combinations tested (At least 2)

Mac

  • Chrome
  • Firefox
  • Safari

Windows

  • Chrome
  • Firefox
  • Edge

Chromebook

  • Chrome

iPad

  • Safari

Android Tablet

  • Chrome
Page not found · GitHub · GitHub
Skip to content
404 “This is not the web page you are looking for”
Copy link
Contributor

@rschamp rschamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks for taking care of this! Just one nit, we don't need to ignore the style shape.

return <div ref={this.setContainer} />;
}
}

DOMElementRenderer.propTypes = {
domElement: PropTypes.instanceOf(Element).isRequired
domElement: PropTypes.instanceOf(Element).isRequired,
style: PropTypes.object // eslint-disable-line react/forbid-prop-types

This comment was marked as abuse.

This comment was marked as abuse.

@rschamp rschamp assigned paulkaplan and unassigned rschamp Jun 28, 2018
@paulkaplan paulkaplan merged commit b58a254 into scratchfoundation:develop Jun 28, 2018
@paulkaplan paulkaplan deleted the fix-stage-styling branch June 28, 2018 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stage becomes huge Small stage mode bug
3 participants