Skip to content

Commit

Permalink
[RNMobile] Bring release v1.22.0 to master (#20155)
Browse files Browse the repository at this point in the history
* [RNMobile] Merge mobile release v1.20.0 back into master (#19562)

* styling fixes after navigation feature merge (#19455)

* Styling fixes to navigation feature

* Add netural styles for toolbar

* Fix condition for not registered component

* Display 'Unsupported' in breadcrumbs for missing components

* Refactor after CR

* Remove leftovers

* [FIX] rich text focus loop (#19240)

* check if onBlur event contains text that is different than value

* add check if there is a text in native event

* Prevent re-selection of RichText when native selection changes as a result of resigning focus

* Fix typo

* Check if isSelected only in onSelectionChangeFromAztec

Co-authored-by: Jorge Bernal <jbernal@gmail.com>

* [RNMobile] Correct displaying photo during upload (#19502)

* [RNMobile] Fix crash once adding Group (#19457)

* Add extra branch for travis to run tests onto

Co-authored-by: Luke Walczak <lukasz.walczak.pwr@gmail.com>
Co-authored-by: Drapich Piotr <drapich.piotr@gmail.com>
Co-authored-by: Jorge Bernal <jbernal@gmail.com>

* Adding empty function to RichText children call. (#19818)

This fixes a crash originated on this PR:
#19536
`

* Disable gallery image size options on mobile (#19828)

* [Mobile] Fix blank image size labels on mobile (#19800) (#20045)

* Fix blank image size labels on mobile

* Use name instead of label in default imageSizes

* [RNMobile] Enable Dismiss on PlainText in Android (#20095)

* Add flag for determining if running on Android

* Enable Dismiss button on PlainText. Enable show keyboard in Android on PlainText mount

* Enable Dismiss button on PlainText. Enable show keyboard in Android on PlainText mount

Co-authored-by: Tugdual de Kerviler <dekervit@gmail.com>
Co-authored-by: Luke Walczak <lukasz.walczak.pwr@gmail.com>
Co-authored-by: Drapich Piotr <drapich.piotr@gmail.com>
Co-authored-by: Jorge Bernal <jbernal@gmail.com>
Co-authored-by: etoledom <etoledom@icloud.com>
Co-authored-by: Matthew Kevins <mkevins@users.noreply.github.com>
Co-authored-by: Chip <chip.snyder3@gmail.com>
  • Loading branch information
8 people committed Feb 11, 2020
1 parent b3f900c commit 7dda20a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ branches:
only:
- master
- rnmobile/master
- rnmobile/releases
- /rnmobile\/release.*/
- /wp\/.*/

env:
Expand Down
23 changes: 20 additions & 3 deletions packages/block-editor/src/components/plain-text/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,39 @@ import styles from './style.scss';
export default class PlainText extends Component {
constructor() {
super( ...arguments );
this.isIOS = Platform.OS === 'ios';
this.isAndroid = Platform.OS === 'android';
}

componentDidMount() {
// if isSelected is true, we should request the focus on this TextInput
if ( this._input.isFocused() === false && this.props.isSelected ) {
this.focus();
if ( this.isAndroid ) {
/*
* There seems to be an issue in React Native where the keyboard doesn't show if called shortly after rendering.
* As a common work around this delay is used.
* https://github.com/facebook/react-native/issues/19366#issuecomment-400603928
*/
this.timeoutID = setTimeout( () => {
this._input.focus();
}, 100 );
} else {
this._input.focus();
}
}
}

componentDidUpdate( prevProps ) {
if ( ! this.props.isSelected && prevProps.isSelected && this.isIOS ) {
if ( ! this.props.isSelected && prevProps.isSelected ) {
this._input.blur();
}
}

componentWillUnmount() {
if ( this.isAndroid ) {
clearTimeout( this.timeoutID );
}
}

focus() {
this._input.focus();
}
Expand Down

0 comments on commit 7dda20a

Please sign in to comment.