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

Set minHeight based on fontSize or style. #14344

Merged
merged 2 commits into from
Mar 8, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/editor/src/components/rich-text/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ export class RichText extends Component {

this.lastEventCount = undefined; // force a refresh on the native side
}
let minHeight = 0;
let minHeight = this.props.fontSize ? this.props.fontSize : styles[ 'editor-rich-text' ].minHeight;
Copy link
Contributor

@hypest hypest Mar 8, 2019

Choose a reason for hiding this comment

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

👋 @SergioEstevao , I think the fontSize value is too small as an initial value for the Android side. If you see the minHeights previously used (https://github.com/wordpress-mobile/gutenberg-mobile/blob/develop/src/variables.android.scss#L9-L11) you'll notice that the values are greater than 50. A quick test I did with this current implementation shows a value of 24 in fontSize.

Currently, the glitch is still noticeable in the title block for example.

if ( style && style.minHeight ) {
minHeight = style.minHeight;
}
Expand Down
1 change: 1 addition & 0 deletions packages/editor/src/components/rich-text/style.native.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
.editor-rich-text {
font-family: $default-regular-font;
text-decoration-color: $gray;
min-height: $min-height-paragraph;
}