rolandleth / LTHPasscodeViewController

iOS 7 style Passcode Lock
MIT License
615 stars 142 forks source link

Dismiss keyboard, no way to get it back #171

Closed roarapps closed 7 years ago

roarapps commented 7 years ago

On an iPad, if you tap on the close keyboard button at the bottom right.

Even if you tap on the digits, there is no way for the keyboard to come back up

rolandleth commented 7 years ago

Hello,

Does it also happen on the demo app? Turning on / changing / turning off? Does it also happen on the simulator? Because I don't have a real iPad to debug the issue.

roarapps commented 7 years ago

Replicated on the demo app on the simulator, just run it in an ipad sim

rolandleth commented 7 years ago

When does it happen?

roarapps commented 7 years ago

Anytime the lock screen comes up, either to enable to the passcode or to unlock the screen.

its easy to replicate - 1) Set device sim to iPad 2) enable lockcode, the lockscreen comes up with the keyboard, tap on the dismiss keyboard button at the bottom right.

rolandleth commented 7 years ago

Thank you! I'll try to look into it when I get home. Any particular iOS version it happens on?

roarapps commented 7 years ago

I;m guessing it would happen on all iPad version that have the dismiss keyboard button.

In your MakeDigitField method, you have "field.userInteractionEnabled = NO;" which is probably not allowing the keyboard to come up when you tap on it.

Also, probably should open a different issue, could you modify

define LTHMainWindow [UIApplication sharedApplication].windows[0]

to

define LTHMainWindow [UIApplication sharedApplication].windows[ [UIApplication sharedApplication].windows.count - 1]

?

rolandleth commented 7 years ago

I don't know the code by heart, but you might be right about the keyboard.

Even though your solution makes more sense, I'm not 100% confident about making a change there. There's a comment next to it, and an issue marked with needs-help about it, and, to be honest, I fear it might break something.

Would #undef + redefining it work? Might not, being declared inside the library, but you could give it a try.

Nonetheless, I'll also look into the change, and test it out, but it would help tremendously if you could also have a look, especially since you're using more than one window, as far as I understood.

roarapps commented 7 years ago

I think as you always want the topmost window, the suggested change would be safe. I didn't have luck with undef. It would be awesome if it could be incorporated as i don't want to modify a local copy of the code.

rolandleth commented 7 years ago

The userInteraction is set to false on fields because there's a hidden textField that acts as a proxy for entering the passcode, and the focus is on that. The problem lies in how the iPad treats soft vs hard keyboards, and for that I'll need a real device. I'll try to look at it Monday.

Also, using windows.count - 1 breaks the case where there's an actionSheet visible when displaying the lockscreen: after closing the sheet, you can't enter the passcode anymore. At this point, I'm not sure how developers are using the library, and I'd rather not make their users end up in a state where they can't use the app anymore.

rolandleth commented 7 years ago

Fixed in 3.8.4.