IQKeyboardManager icon indicating copy to clipboard operation
IQKeyboardManager copied to clipboard

Previous button in IQKeyboardReturnManager doesn’t navigate to UITextFields in off-screen UITableView cells

Open bhaveshbc opened this issue 3 months ago • 0 comments

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:

  1. Run the demo project from IQKeyboard.
  2. Tap on a UITableView row.
  3. Use the Next button repeatedly until you reach the last row — works fine.
  4. 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.

bhaveshbc avatar Oct 14 '25 05:10 bhaveshbc