Open Deadpikle opened 10 years ago
For anyone finding this bug, you can fix it by adding the following to the end of the commonInitialization function of RichTextEditor.m: self.currSysVersion = [[[UIDevice currentDevice] systemVersion] floatValue]; if (self.currSysVersion >= 8.0) self.layoutManager.allowsNonContiguousLayout = NO;
This fix is based upon // http://stackoverflow.com/questions/26454037/uitextview-text-selection-and-highlight-jumping-in-ios-8 .
Hi,
In iOS 8, hitting enter (return) in a bullet list at the bottom of the text does not scroll properly to the bottom of the text view (i.e. to self.selectedRange) but instead scrolls from the top of the text view to the bottom. In iOS 7.1, you can get rid of scrolling issues by utilizing the scrolling fixes in PSPDFTextView ( https://github.com/steipete/PSPDFTextView ) In iOS 8, however, when the attributedText is changed in richTextEditorToolbarDidSelectBulletList, the UITextView scrolls from the top to the self.selectedRange, which technically works for the user, but it is super ugly as it scrolls from top to bottom every time you hit enter to continue the bullet list. I am fairly certain that the problem lies with setting self.attributedText when adding a bullet, but I could be wrong.
In iOS 8, I have tried not inheriting from PSPDFTextView and instead "fixing" the cursor issue myself by adding:
[self scrollRangeToVisible:self.selectedRange];
to textViewDidChangeSelection. This does "fix" the issue where UITextViews don't scroll down properly when the user hits enter at the end of the UITextView (regardless of whether you're in a list or not), but the weird scroll from top to bottom issue still remains.You can replicate this in the demo application.
Thanks!