SkyFloatingLabelTextField icon indicating copy to clipboard operation
SkyFloatingLabelTextField copied to clipboard

Title stay in selected style when the keyboard is dismissed interactively

Open amarcadet opened this issue 8 years ago • 7 comments

In my case I have a UITableViewCell subclass that contains a SkyFloatingLabelTextField. The UITableView is configured in interactive mode for the keyboard dismiss self.tableView.keyboardDismissMode = .Interactive.

When I do while having a textfield focused, the title keep the "selected style" even though I'm not editing anymore.

Thanks for your help!

amarcadet avatar May 21 '16 16:05 amarcadet

After few more tests it occurs that this bug only happens when you dismiss the keyboard with the first touch on the text field and drag down from that point.

Once the text field is in that state, it's not possible to go back to the normal state, the title stay selected even if I dismiss the keyboard without touching the text field.

I don't know if the use case is clear enough, if not I'll try to add a sample project and gif.

amarcadet avatar May 23 '16 09:05 amarcadet

I was facing a similar issue and solved it by setting highlighted = false on resignFirstResponder():

class CustomTextField: SkyFloatingLabelTextField {
    override func resignFirstResponder() -> Bool {
            let result =  super.resignFirstResponder()
            if result {
                highlighted = false
            }
            return result
    }
}

jakunico avatar Jun 23 '16 17:06 jakunico

+1

cooler333 avatar Aug 16 '16 15:08 cooler333

@jakunico This doesn't fix it. This help to remove highlight state, but sometimes, title stay highlighted.

cooler333 avatar Aug 16 '16 16:08 cooler333

I am seeing an issue where I have SkyFloatingLabelTextField's on a UITableViewCell and while clicking and dragging to scroll the tableview over other cells seems to somehow set the highlighted state on the textfields (maybe its an issue in cell reuse). I've tried resetting highlighted state but this seems to come later that when I can inject/change it. Selecting the text field and deselecting doesn't seem to get it out of the highlighted state. I'm not sure where to proceed but there seems to be some issues using highlighted.

maarek avatar Oct 12 '16 18:10 maarek

Same thing happening here, i have a view with 4 textfields, if i start filling them by tapping on the first one and proceeding trough them by the keyboard next button, just the one that i tapped stays with the selection color, the rest turns back to the normal color. After analyzing, i realized that only the fields that you tap stays with the selection color after populated, if you populate a field by getting to it trough the next button, the selection color does not stick to it.

joaovbalmeida avatar Oct 05 '17 18:10 joaovbalmeida

Managed to fix by setting highlighted on viewdidload

textField.isHighlighted = true

joaovbalmeida avatar Oct 05 '17 18:10 joaovbalmeida