Automattic / stories-android

Loop concept app - WP Stories library
GNU General Public License v2.0
20 stars 6 forks source link

Enhancement: remove underline and default cursor during text editing #533

Open megsfulton opened 4 years ago

megsfulton commented 4 years ago

The default OS behavior on android is to display an additional cursor indicator and underline the current word.

It causes some issues during the text editing experience where it looks like there are two cursors when changing the text alignment.

It looks like some other apps (and gutenberg) get around this somehow?

aforcier commented 4 years ago

The blue drop indicator that appears is a standard system copy/paste helper (if you tap the dot when it appears an extra menu with things like 'Select all' or 'Paste' should appear). I'm not sure there's much we can do about it other than disabling copy/paste for the text.

However there is some wonkiness when changing text alignment we might be able to change, it's captured in https://github.com/Automattic/stories-android/issues/510.

The underline is also attached to the system keyboard/autocorrect settings I believe.

I'm seeing the same cursor/underline behavior in Gutenberg and some other apps I checked, do you have some examples I could look at for different behavior?

megsfulton commented 4 years ago

Interesting, I don't see it in Gutenberg on my Pixel or Pixel 2.

When I was testing other apps, Snapchat and Tiktok didn't have the underline or blue drop indicator. Instagram retains it and has the same issue that was reported.

aforcier commented 4 years ago

Interesting, I don't see it in Gutenberg on my Pixel or Pixel 2.

🤔 that's odd, I tested on a Pixel 3. @mzorz could you check also when you can?

When I was testing other apps, Snapchat and Tiktok didn't have the underline or blue drop indicator. Instagram retains it and has the same issue that was reported.

I can confirm the underline doesn't appear in Snapchat while typing. Though for me when tapping anywhere in the text the dot appears as normal (it's themed to green in their case), and also the tapped-on word is underlined. They're probably using some customization to remove the underline as you type.

mzorz commented 4 years ago

This is normal behavior, related to the keyboard's suggestion functionality: the selected word on the suggestions carousel matches the EditText underlined word, apparently this is to indicate the user if they tap on the item in the carousel, the underlined word is the one to be replaced.

In the case of Gutenberg it seems we're applying a patch for a different reason that ends up affecting the behavior in the way described above - but there it's alright since suggestions still work. (also note the PR talks about headers mainly, but it also is applying the patch for paragraph blocks as well so, pretty much all "writing" blocks backed up by Aztec on Android in this case).

Other apps may be overriding it for reasons.

We could disable suggestions entirely, or tweak the functionality for example by removing the suggestion span on the text (suggestions would still work on the keyboard but the underline wouldn't appear, but not sure if this is what we want). I would stick to normal behavior, but let me know 👍

megsfulton commented 4 years ago

Let's go ahead and leave the default behaviors in place for now. We can revisit if we get more feedback on this later.

aforcier commented 4 years ago

Sounds good (though I'm still not sure why Gutenberg is behaving differently for me, maybe it's the Pixel 3). I'll mark as Not-MVP and we can dig it back up if we get more feedback.