ibireme / YYText

Powerful text framework for iOS to display and edit rich text.
MIT License
8.84k stars 1.68k forks source link

Fix YYTextView selection bug that selection cannot be done when selecting one more line (trigger scrolling action) #953

Open wolfcon opened 3 years ago

wolfcon commented 3 years ago

YYTextView 嵌套进 UIScrollView (一般是 UITableView)中时, 使用选择功能选择多行数据时同时会触发 UIScrollView 滚动, 导致无法选择多行.

修复这个 bug. 增加了一个嵌套时需要共同响应的属性 interactiveSuperScrollView, 设置后, 将会正常屏蔽 UIScrollView 的滚动.

鉴于可能导致功能异常的问题, 没有采用自动方案

当然可以更加自动, 检测父 View 为 ScrollView, 但是这样的话, 在复杂逻辑时, 比如父 View 有 2 个以上的 ScrollView , 其中有部分业务代码还控制 scrollEnabled 的属性, 则可能导致功能异常.

wolfcon commented 3 years ago

421 #736 #388 #775

xia0m1ng commented 2 years ago

YYTextView.h 文件结尾好像少了 @ end。顺便感谢解决方案。

wolfcon commented 2 years ago

从代码中抽离代码的时候漏掉了🤣