apasccon / SearchTextField

UITextField subclass with autocompletion suggestions list
MIT License
1.15k stars 253 forks source link

List Off-Screen When Direction Is .up #127

Open jngr opened 6 years ago

jngr commented 6 years ago

Thank you for this very useful and flexible implementation. I have encountered a problem when using it in landscape mode. With the keyboard visible the direction is typically .up, and the list ends up being higher than the available space and partially of the screen.

In line 302 (height calculation for direction .up) shouldn't it simply be let tableHeight = min(tableView.contentSize.height, frame.origin.y )

or, with a small margin on top for better looks let tableHeight = min(tableView.contentSize.height, frame.origin.y - topMargin )

MarcoCarnevali commented 6 years ago

Yeah it's working very good!

yahyatabba commented 4 years ago

Please, How can I fix this with the last version?