-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
Describe the bug
When a UITextField is inside a UITableView, the Next button in the keyboard toolbar works correctly even for cells that are not currently visible on the screen.
However, the Previous button only works for text fields that are visible. If a cell is off-screen, the Previous stops and does not scroll or move to the text field.
To Reproduce
Steps to reproduce the behavior:
- Run the demo project from IQKeyboard.
- Tap on a UITableView row.
- Use the Next button repeatedly until you reach the last row — works fine.
- Now use the Previous button to move back toward the first row.
Observation:
The Previous button only navigates among visible rows. Once you scroll past the visible range, it stops working for off-screen cells.
Expected behavior
The Previous button should behave the same as the Next button — automatically navigating (and scrolling) to text fields in all rows, even those that are not visible on screen.
Versions
Xcode: 26
Simulator/Device: iPhone 17 Pro
Library Version: 8.0.1
Additional context
It seems that IQKeyboardReturnManager only registers responder subviews for cells currently visible in the table view. Since off-screen cells are not loaded into the view hierarchy, their text fields are not included in the responder chain. Therefore, the Previous button cannot navigate to them.