Skip to content

Commit

Permalink
[FIX] inserter point in mobile app (#20195)
Browse files Browse the repository at this point in the history
* fix inserter point in gutenberg-mobile
  • Loading branch information
dratwas committed Feb 18, 2020
1 parent 322da29 commit fcdd316
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,13 @@ export class BlockList extends Component {
withFooter = true,
isReadOnly,
isRootList,
shouldShowInsertionPointBefore,
shouldShowInsertionPointAfter,
} = this.props;

const forceRefresh =
shouldShowInsertionPointBefore || shouldShowInsertionPointAfter;

return (
<View
style={ { flex: isRootList ? 1 : 0 } }
Expand All @@ -116,6 +121,7 @@ export class BlockList extends Component {
scrollViewStyle={ { flex: isRootList ? 1 : 0 } }
data={ blockClientIds }
keyExtractor={ identity }
extraData={ forceRefresh }
renderItem={ this.renderItem }
shouldPreventAutomaticScroll={
this.shouldFlatListPreventAutomaticScroll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { getDefaultBlockName } from '@wordpress/blocks';
/**
* Internal dependencies
*/
import BlockInsertionPoint from '../block-list/insertion-point';
import styles from './style.scss';

export function DefaultBlockAppender( {
Expand All @@ -24,6 +25,7 @@ export function DefaultBlockAppender( {
onAppend,
placeholder,
containerStyle,
showSeparator,
} ) {
if ( isLocked || ! isVisible ) {
return null;
Expand All @@ -40,7 +42,11 @@ export function DefaultBlockAppender( {
style={ [ styles.blockHolder, containerStyle ] }
pointerEvents="box-only"
>
<RichText placeholder={ value } onChange={ () => {} } />
{ showSeparator ? (
<BlockInsertionPoint />
) : (
<RichText placeholder={ value } onChange={ () => {} } />
) }
</View>
</TouchableWithoutFeedback>
);
Expand Down

0 comments on commit fcdd316

Please sign in to comment.