Fix native emojis being cutoff in emoji picker (#3358)

This commit is contained in:
Elias Nahum 2019-10-07 09:11:53 +03:00 committed by GitHub
parent a5b096fd44
commit c8e2a66f9f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -72,7 +72,7 @@ export default class EmojiPicker extends PureComponent {
this.sectionListGetItemLayout = sectionListGetItemLayout({
getItemHeight: () => {
return (EMOJI_SIZE + 5) + (EMOJI_GUTTER * 2);
return (EMOJI_SIZE + 7) + (EMOJI_GUTTER * 2);
},
getSectionHeaderHeight: () => SECTION_HEADER_HEIGHT,
});
@ -161,7 +161,7 @@ export default class EmojiPicker extends PureComponent {
let lastOffset = 0;
return emojiSections.map((section) => {
const start = lastOffset;
const nextOffset = (section.data.length * (EMOJI_SIZE + (EMOJI_GUTTER * 2))) + SECTION_HEADER_HEIGHT;
const nextOffset = (section.data.length * ((EMOJI_SIZE + 7) + (EMOJI_GUTTER * 2))) + SECTION_HEADER_HEIGHT;
lastOffset += nextOffset;
return start;
@ -216,7 +216,7 @@ export default class EmojiPicker extends PureComponent {
getNumberOfColumns = (deviceWidth) => {
const shorten = DeviceTypes.IS_IPHONE_WITH_INSETS && this.props.isLandscape ? 4 : 2;
return Math.floor(Number(((deviceWidth - (SECTION_MARGIN * shorten)) / (EMOJI_SIZE + (EMOJI_GUTTER * shorten)))));
return Math.floor(Number(((deviceWidth - (SECTION_MARGIN * shorten)) / ((EMOJI_SIZE + 7) + (EMOJI_GUTTER * shorten)))));
};
renderItem = ({item}) => {

View file

@ -27,7 +27,7 @@ export default class EmojiPickerRow extends Component {
renderEmojis = (emoji, index, emojis) => {
const {emojiGutter, emojiSize} = this.props;
const size = emojiSize + 5;
const size = emojiSize + 7;
const style = [
styles.emoji,
{