-
Notifications
You must be signed in to change notification settings - Fork 58
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
Update caret position after inserting link #716
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified on Andorid, works like a charm LGTM
@SergioEstevao could you please check for the iOS side? Thanks! |
Sorry for the late input on this but, I'm wondering if the behavior implemented here will match the web's side behavior and whether any fixes should be done on the web side too. What do you think @pinarol ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is working correctly on iOS. Good work!
@hypest 👋 I checked the convo for the same issue on for the web side, I based my fix on that one #679 (comment) I hope I didn't miss any other thing |
just adding the related comment for the web side WordPress/gutenberg#7980 (comment) |
hey @hypest 👋I did some investigation about how to share the caret positioning logic after inserting a link between web and mobile.
|
Thanks for the analysis @pinarol . Seems like we prbably need to break up some functions to smaller ones so that we can keep the cross-platform parts the same and only nativize the rest. Can you seek out the person working on it on the web side (if someone is already) or come up with a proposal (PR even) we can run by our web side friends? |
@hypest as we discussed today I've opened an issue to do the follow up later since there's still an ongoing convo on web side. #737 I reverted the line which makes mobile behavior differ from web, currently web and mobile behaves same. Also updated the 'Test 3 - Select a text and add a link' in the description |
hey @mzorz could you be able to check this again? I made a small change and updated Test 3, also updated the branch from develop. |
Tested! Verified all 3 test cases work correctly. I found one weird case by mistake:
I think it would be wise to do some URL validation if we are not doing it? And if we are, then something's not working well there :) I understand this is not specific to this PR which only cares about caret positioning so, I'm going to give this one the go, and open another issue for this. EDIT: reported here #740 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
…rg-mobile into issue/707-Placeholder-is-missing-on-Heading-block * 'develop' of https://github.com/wordpress-mobile/gutenberg-mobile: Update caret position after inserting link (#716) # Conflicts: # gutenberg
…rg-mobile into issue/345-fix-for-press-delete-no-merge-move-focus * 'develop' of https://github.com/wordpress-mobile/gutenberg-mobile: (39 commits) Update gb hash after merging the companion PR Update GB ref Update gutenberg ref Update gutenberg ref Update gutenberg ref Tests: Add mock for the newly added CSS class Update GB ref Raise the minHeight value for heading block to 60 (it was 50) Introduce a constant for the string `tag` and use it instead of the hard coded string Make `tagName` private Update heading placeholder size on heading level change (#742) Fix - HTML Editor - Keyboard can not be closed (#743) Update gutenberg ref Update gutenberg ref Update GB ref Add comments Update caret position after inserting link (#716) Update GB hash Reuse `blockType` instead of adding a new property Update GB ref ... # Conflicts: # src/block-management/block-holder.js
To Fix: #679
Gutenberg PR: WordPress/gutenberg#14317
With this PR we are putting the caret at the end of the linked text when we insert a link. This needs to be tested both on Android & iOS.
Following screen captures are taken from this PRs branch:
iOS:
Android:
TO TEST
Testing prerequisites
For WPiOS
Checkout the PRs branch to any arbitrary folder and cd .. to it
run yarn install, yarn start
Open XCode WPiOS on the latest develop
Clean build folder on Xcode, and then run the app
For WPAndroid
open grade.properties at WordPress-Android folder
add wp.BUILD_GUTENBERG_FROM_SOURCE = true to grade.properties
checkout the PRs branch in the subrepo of WordPress-Android repo
cd to WordPress-Android/libs/gutenberg-mobile
run yarn install, yarn start
yarn wpandroid on a separate terminal in the same directory
Test steps:
Test 1 - Inserting link when no text is selected
Test 2 - Editing an existing link
Test 3 - Select a text and add a link