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 for extra BR tag on Title field on Android #16021

Merged
merged 2 commits into from Jun 7, 2019

Conversation

Projects
None yet
5 participants
@daniloercoli
Copy link
Contributor

commented Jun 6, 2019

This PR is a fix for wordpress-mobile/gutenberg-mobile#1078 (Pressing enter on the title creates a BR tag)
It does set the proper props to instruct AztecWrapper on Android to remove the new line char ( converted to BR on HTML ) when Enter.key is pressed on the keyboard.

GB-mobile PR: wordpress-mobile/gutenberg-mobile#1095

@daniloercoli

This comment has been minimized.

Copy link
Contributor Author

commented Jun 7, 2019

@hypest Not sure if it's worth to default the deleteEnter prop in RichText for mobile to true.
deleteEnter={ this.props.deleteEnter !== undefined ? this.props.deleteEnter : true }
(Or change it to true in the native wrapper in Android)

This way there is no need to other fields to declare it to true every time.

@SergioEstevao
Copy link
Contributor

left a comment

Tested it on the demo app and it's looking good.

@mkevins

mkevins approved these changes Jun 7, 2019

Copy link
Contributor

left a comment

Tested on WP-Android (aabfb2baf), and this works as described.

@hypest

This comment has been minimized.

Copy link
Contributor

commented Jun 7, 2019

Not sure if it's worth to default the deleteEnter prop in RichText for mobile to true.
deleteEnter={ this.props.deleteEnter !== undefined ? this.props.deleteEnter : true }
(Or change it to true in the native wrapper in Android)

This way there is no need to other fields to declare it to true every time.

The default is false pretty much. For example, the list block let's Aztec handle the Enter within its internal handling of the lists. Other blocks might need similar approach (to let Aztec handle it), that's why I left it default to false. We might want to revise in the future, when we will have a better picture of what do the blocks need from Aztec most of the times, and change the default. Is it OK with you to leave it to false for the time being @daniloercoli ?

@daniloercoli

This comment has been minimized.

Copy link
Contributor Author

commented Jun 7, 2019

Sure, i'm ok with that @hypest. Let's merge this 🚀

@daniloercoli daniloercoli merged commit 1fbcd78 into master Jun 7, 2019

1 check passed

Travis CI - Pull Request Build Passed
Details

@daniloercoli daniloercoli deleted the rnmobile/quick-fix-for-br-tag-in-title-android branch Jun 7, 2019

@youknowriad youknowriad added this to the Gutenberg 5.9 milestone Jun 7, 2019

nicolad added a commit to nicolad/gutenberg that referenced this pull request Jun 15, 2019

[RNMobile] Fix for extra BR tag on Title field on Android (WordPress#…
…16021)

* Remove extra BR tag that may happen at the end of the Title field on Android when pressing Enter.key

* Make sure to set `deleteEnter={ true }` so that Android does delete the new line / BR tag on enter pressed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.