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

Mobile Release v1.75.0 #40630

Merged
merged 20 commits into from
Apr 29, 2022
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
7473046
Release script: Update react-native-editor version to 1.74.0
Apr 14, 2022
6f89f35
Release script: Update with changes from 'npm run core preios'
Apr 14, 2022
f04c036
Update CHANGELOG
Apr 14, 2022
8787a69
Release script: Update react-native-editor version to 1.75.0
Apr 26, 2022
5651a1e
Commit changes from "npm run core preios"
Apr 26, 2022
cc03315
[RNMobile] Prevent unnecessary re-renders of RichText component due t…
fluiddot Apr 26, 2022
18483c0
Mobile - RichText - Set a default value for selectionStart / selectio…
Apr 26, 2022
68bf03d
Embed block: Fix inline preview cut-off when editing URL (#35326)
fluiddot Apr 19, 2022
b97f8d5
[RNMobile] Upgrade to AztecAndroid 1.5.7 (#40099)
mchowning Apr 15, 2022
7746f8c
Add constants file to Spacer block (#40446)
fluiddot Apr 20, 2022
1d6e193
Use CSS to transform text into title case (#40550)
Apr 25, 2022
fcb9abf
Mobile - Notice list - Updates the code with the following: (#40415)
Apr 20, 2022
4a11173
Mobile - Layout - Set a background color for the toolbar (#40266)
Apr 18, 2022
79c5553
[RNMobile] - Update tests with paragraph blocks to work on both envir…
jostnes Apr 27, 2022
ca3e18f
Mobile - HTML View - Add a top margin to avoid the tooltip overlappin…
Apr 27, 2022
4d91a1a
[RNMobile] Add featured image settings to the Latest Posts block (#39…
Apr 27, 2022
f7626e5
Update CHANGELOG with user-facing changes
Apr 28, 2022
72a45b9
Merge commit '04d733dd911874bc6aea5a01a437d0c136fa2137' into rnmobile…
mchowning Apr 28, 2022
a462c7e
Merge remote-tracking branch 'origin/trunk' into rnmobile/release_1.75.0
mchowning Apr 28, 2022
8aa2c93
Merge remote-tracking branch 'origin/trunk' into rnmobile/release_1.75.0
mchowning Apr 28, 2022
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
Prev Previous commit
Next Next commit
Mobile - RichText - Set a default value for selectionStart / selectio…
…nEnd for undefined values (#40581)
  • Loading branch information
Gerardo Pacheco authored and Siobhan committed Apr 26, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 18483c0c4d08649f354452af5183d6264351837d
13 changes: 8 additions & 5 deletions packages/rich-text/src/component/index.native.js
Original file line number Diff line number Diff line change
@@ -1048,6 +1048,8 @@ export class RichText extends Component {
accessibilityLabel,
disableEditingMenu = false,
baseGlobalStyles,
selectionStart,
selectionEnd,
} = this.props;
const { currentFontSize } = this.state;

@@ -1074,12 +1076,14 @@ export class RichText extends Component {
defaultTextDecorationColor
);

const currentSelectionStart = selectionStart ?? 0;
const currentSelectionEnd = selectionEnd ?? 0;
let selection = null;
if ( this.needsSelectionUpdate ) {
this.needsSelectionUpdate = false;
selection = {
start: this.props.selectionStart,
end: this.props.selectionEnd,
start: currentSelectionStart,
end: currentSelectionEnd,
};

// On AztecAndroid, setting the caret to an out-of-bounds position will crash the editor so, let's check for some cases.
@@ -1095,12 +1099,11 @@ export class RichText extends Component {
brBeforeParaMatches[ 0 ].match( /br/g ) || []
).length;
if ( count > 0 ) {
let newSelectionStart =
this.props.selectionStart - count;
let newSelectionStart = currentSelectionStart - count;
if ( newSelectionStart < 0 ) {
newSelectionStart = 0;
}
let newSelectionEnd = this.props.selectionEnd - count;
let newSelectionEnd = currentSelectionEnd - count;
if ( newSelectionEnd < 0 ) {
newSelectionEnd = 0;
}