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

RNMobile: Fix autoscroll on ListBlock #15048

Merged
merged 5 commits into from
Apr 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ exports[`BlockControls should render a dynamic toolbar of controls 1`] = `
"clientId": undefined,
"isSelected": true,
"name": undefined,
"onCaretVerticalPositionChange": undefined,
"onFocus": undefined,
}
}
Expand Down
8 changes: 4 additions & 4 deletions packages/block-editor/src/components/block-edit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ class BlockEdit extends Component {
);
}

propsToContext( name, isSelected, clientId, onFocus ) {
return { name, isSelected, clientId, onFocus };
propsToContext( name, isSelected, clientId, onFocus, onCaretVerticalPositionChange ) {
return { name, isSelected, clientId, onFocus, onCaretVerticalPositionChange };
}

render() {
const { name, isSelected, clientId, onFocus } = this.props;
const value = this.propsToContext( name, isSelected, clientId, onFocus );
const { name, isSelected, clientId, onFocus, onCaretVerticalPositionChange } = this.props;
const value = this.propsToContext( name, isSelected, clientId, onFocus, onCaretVerticalPositionChange );

return (
<BlockEditContextProvider value={ value }>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,7 @@ const RichTextContainer = compose( [
return {
isSelected: context.isSelected,
clientId: context.clientId,
onCaretVerticalPositionChange: context.onCaretVerticalPositionChange,
};
}

Expand All @@ -769,6 +770,7 @@ const RichTextContainer = compose( [
clientId: context.clientId,
isSelected: context.isSelected,
onFocus: context.onFocus || ownProps.onFocus,
onCaretVerticalPositionChange: context.onCaretVerticalPositionChange,
};
} ),
] )( RichText );
Expand Down
1 change: 0 additions & 1 deletion packages/block-library/src/heading/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ class HeadingEdit extends Component {
} }
onFocus={ this.props.onFocus } // always assign onFocus as a props
onBlur={ this.props.onBlur } // always assign onBlur as a props
onCaretVerticalPositionChange={ this.props.onCaretVerticalPositionChange }
onChange={ ( value ) => setAttributes( { content: value } ) }
onMerge={ mergeBlocks }
onSplit={ this.splitBlock }
Expand Down
1 change: 0 additions & 1 deletion packages/block-library/src/paragraph/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ class ParagraphEdit extends Component {
isSelected={ this.props.isSelected }
onFocus={ this.props.onFocus } // always assign onFocus as a props
onBlur={ this.props.onBlur } // always assign onBlur as a props
onCaretVerticalPositionChange={ this.props.onCaretVerticalPositionChange }
style={ style }
onChange={ ( nextContent ) => {
setAttributes( {
Expand Down