Skip to content

Commit

Permalink
Rewrite to please the linter
Browse files Browse the repository at this point in the history
  • Loading branch information
hypest committed Apr 24, 2021
1 parent d8a9258 commit 7ab5f03
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/block-editor/src/components/block-list/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ export class BlockList extends Component {
isBlockInsertionPointVisible !==
prevProps.isBlockInsertionPointVisible
) {
const insertionPointInRootList = insertionPoint.rootClientId === undefined;
const insertionPointInRootList =
insertionPoint.rootClientId === undefined;
if ( insertionPointInRootList && isBlockInsertionPointVisible ) {
const jumpToIndex = insertionPoint.index - 1; // scrolling goes to the bottom of the item so, let's scroll to one above
const offset =
Expand All @@ -209,9 +210,11 @@ export class BlockList extends Component {
blockClientIds,
jumpToIndex
);
Platform.OS === 'android'
? this.scrollViewRef.scrollToOffset( { offset } )
: this.scrollViewRef.scrollTo( { y: offset } );
if ( Platform.OS === 'android' ) {
this.scrollViewRef.scrollToOffset( { offset } );
} else {
this.scrollViewRef.scrollTo( { y: offset } );
}
}
}
}
Expand Down

0 comments on commit 7ab5f03

Please sign in to comment.