hackiftekhar / IQKeyboardManager

Codeless drop-in universal library allows to prevent issues of keyboard sliding up and cover UITextField/UITextView. Neither need to write any code nor any setup required and much more.
MIT License
16.46k stars 2.41k forks source link

Tapping toolbar causes UIPickerView to scroll. #1707

Closed Daedren closed 3 years ago

Daedren commented 4 years ago

Describe the bug If a UITextField has an UIPickerView as its input view, tapping the IQKeyboardManager's toolbar triggers the pickerview to scroll.

This makes it so that when you press "Done" to close the keyboard, the pickerview will still scroll when off-screen.

I have tried both with and without translatesAutoresizingMaskIntoConstraints enabled.

To Reproduce Steps to reproduce the behavior:

  1. Set UITextField's inputView to a UIPickerView instance
  2. Tap anywhere on the IQKeyboardManager toolbar when the textfield is the first responder.
  3. The picker scrolls a few rows down.

Expected behavior The UIPickerView shouldn't scroll when it's not clearly tapped. Furthermore it causes issues when manually closing the keyboard.

Versions

Xcode: 11.3.1 Mac OS: 10.15.2 Simulator/Device: iOS 13.3 (17C45) Simulator/Device Name: iPhone 11 Pro Library Version: Tried on both 6.2.0 and 6.5.5

arfnsamsul commented 4 years ago

Hi @Daedren have you found a solution for this? I got same issue.

hackiftekhar commented 4 years ago

In library, we are adding the toolbar with standard way which is to set inputAccessoryView of the textField. If you have set the inputView = pickerView then the problem shouldn't be there. Can you please share the demo project to reproduce the issue?

amrit42087 commented 4 years ago

I am also facing the same issue. Let me share the demo project for it.

https://github.com/amrit42087/UIPickerIssue

amrit42087 commented 4 years ago

I have figured out. This issue is only when using the simulator. It does not occur in the real device. And it has nothing to do with IQKeyboardmanager. It exist in the simulator even if we just tap outside the picker.