Closed Bug 905946 Opened 8 years ago Closed 8 years ago

Inconsistent way of cancelling an autocorrection in case of auto fixing punctuation

Categories

(Firefox OS Graveyard :: Gaia::Keyboard, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mai, Assigned: mai)

Details

Attachments

(1 file)

No description provided.
STR:
1- Select English keyboard
2- Enable autocorrections
3- Open contacts application and add a new contact
3- In the name field, type "bla ?" (without the quotes)
4- Observe how autocorrection flips the space with the puncuation symbol "bla? "
5- Cancel the autocorrection by pressing delete key

   Expected:
       The state of the input field reverts to "bla ?"

   Actual:
       The input fields is replaced by "bla "

Despite the language, the autocorrector should revert to the state just before the autocorrection happens. This behavior is inconsistent because it does not allow the user to type certain character sequences.
Comment on attachment 791209 [details]
keeping the punctuation character when reverting autofixing

Marina,

Thanks for identifying this bug and producing a patch.

I'm giving r- here because fixPunctuation() is also called to convert space space to period space.  With this patch, "  " would change to ". ", and would then revert to " .", which is not what the user typed.

I think that in order to fix that, you'll need to add a second, optional revert to argument to fixPunctuation so that you can change line 543 from:

fixPunctuation(PERIOD)

to 

fixPunctuation(PERIOD, SPACE)

If the second argument is omitted, assume it is the same as the first.
Attachment #791209 - Flags: review?(dflanagan) → review-
Comment on attachment 791209 [details]
keeping the punctuation character when reverting autofixing

Hi, 
I modified the patch considering your comments, and i added a second argument to fixPunctuation method.

Mai
Attachment #791209 - Flags: review- → review?(dflanagan)
Comment on attachment 791209 [details]
keeping the punctuation character when reverting autofixing

Mai,

I'm sorry it has taken me so long to get to this review. Please fix the couple of nits in my github comments, and then set the r? again for me and I'll land it.

Thank you for getting involved in this project!
Attachment #791209 - Flags: review?(dflanagan) → review-
Comment on attachment 791209 [details]
keeping the punctuation character when reverting autofixing

Updated the code, thanks for your comments,
Marina
Attachment #791209 - Flags: review- → review?(dflanagan)
Comment on attachment 791209 [details]
keeping the punctuation character when reverting autofixing

This looks great. Thanks!
Attachment #791209 - Flags: review?(dflanagan) → review+
Landed to master: https://github.com/mozilla-b2g/gaia/commit/8b478f6ed565075e3c0e1f5400743ba4e75950bc
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.