jriosdev / iOSDropDown

Drop Down Menu for iOS With Search And Other Awesome Customisation
https://cocoapods.org/pods/iOSDropDown
MIT License
667 stars 150 forks source link

Keyboard does not come up when I tap on textfield #127

Open tesddev opened 1 year ago

tesddev commented 1 year ago

Even after I set isSearchEnable to true, keyboard fails to come up. See code snippet below.

let senderStateTextField: TesDropDownTextField = {
        let textField = TesDropDownTextField()
        textField.isSearchEnable = true
        textField.placeholder = "Origin"
        return textField
    }()

I then later set the textfield to become firstresponder in the listWillAppear delegate method

senderStateTextField.listWillAppear {
        self.senderStateTextField.becomeFirstResponder()
 }

This brought up the keyboard but brought along several bugs with it.

  1. When I start typing, it creates another list up.
  2. When I select, it dismisses only the first list and leaves the original one
  3. When I click on any of the list in the original list that fails to dismiss, I get an "index out of range error"
  4. Tapping outside doesn't also dismiss the original list.

video demo below:

https://github.com/jriosdev/iOSDropDown/assets/58847828/3faf9b76-27da-4dba-a230-98830c80d2a4

If anyone has a correct way of using the search feature, please help me.