Skip to content

Conversation

@jleandroperez
Copy link
Contributor

Details:

In this PR we're updating the workaround introduced via #814:

  • It'll be executed only when needed: upon text replacement
  • We're switching to fixAttributes (vs invalidateAttributes)
  • Added new unit tests!

Ref. #811

Needs Review: @diegoreymendez

To test:

  1. Verify that the unit tests are green
  2. Launch the empty editor
  3. Insert a newline
  4. Switch to the Chinese Simplified Pinyin keyboard
  5. Type s and tap over any of the replacement suggestions
  6. Repeat the step above.

Verify that the keyboard suggestion selected in (6) remains onscreen.

@SergioEstevao SergioEstevao modified the milestones: Version 1.0 Beta 15, Next Stable Nov 21, 2017
//
if range.length > 0 {
let invalidateRange = NSMakeRange(range.location, attrString.length)
fixAttributes(in: invalidateRange)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any specific reason for calling fixAttributes() instead of invalidateAttributes()?

Invalidate attributes does the same, without forcing a synchronous execution when lazy attribute fixing is on. See the discussion here: https://developer.apple.com/documentation/uikit/nstextstorage/1534025-invalidateattributes

@jleandroperez
Copy link
Contributor Author

@diegoreymendez thanks for bringing that up!. Replaced fixAttributes > invalidateAttributes accordingly. Ready for another look!

@jleandroperez
Copy link
Contributor Author

Closing in favor of #836. @diegoreymendez is a genius!!

@jleandroperez jleandroperez deleted the issue/811-fixing-chinese-h1-input branch November 28, 2017 12:29
@diegoreymendez diegoreymendez removed this from the Version 1.0.0 Beta 16 milestone Dec 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants