Keyboard popping up on iOS

Hi, recently the iOS keyboard has started popping up even when not going into editable fields.

Anyone has similar? Or any ideas how to debug?

I’m getting lots of trace like this which not sure whether is a problem or not:

021-01-29 16:33:50.380937+0100 MIDISynth-Control[932:507896] [LayoutConstraints] Unable to simultaneously satisfy constraints.

Probably at least one of the constraints in the following list is one you don’t want.

Try this:

(1) look at each constraint and try to figure out which you don’t expect;

(2) find the code that added the unwanted constraint or constraints and fix it.

(Note: If you’re seeing NSAutoresizingMaskLayoutConstraints that you don’t understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)

(

"<NSAutoresizingMaskLayoutConstraint:0x283c6f4d0 h=–& v=–& _UIButtonBarButton:0x11d0866b0.height == 0 (active)>",

"<NSLayoutConstraint:0x283c63110 _UIUCBKBSelectionBackground:0x11d086eb0.bottom == _UIButtonBarButton:0x11d0866b0.bottom - 6 (active)>",

"<NSLayoutConstraint:0x283c63070 V:|-(6)-[_UIUCBKBSelectionBackground:0x11d086eb0] (active, names: ‘|’:_UIButtonBarButton:0x11d0866b0 )>"

)

Will attempt to recover by breaking constraint

<NSLayoutConstraint:0x283c63110 _UIUCBKBSelectionBackground:0x11d086eb0.bottom == _UIButtonBarButton:0x11d0866b0.bottom - 6 (active)>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.

The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.

2021-01-29 16:33:50.381676+0100 MIDISynth-Control[932:507896] [LayoutConstraints] Unable to simultaneously satisfy constraints.

Probably at least one of the constraints in the following list is one you don’t want.

Try this:

(1) look at each constraint and try to figure out which you don’t expect;

(2) find the code that added the unwanted constraint or constraints and fix it.

(Note: If you’re seeing NSAutoresizingMaskLayoutConstraints that you don’t understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)

(

"<NSAutoresizingMaskLayoutConstraint:0x283c6f1b0 h=–& v=–& _UIButtonBarButton:0x11d03c690.height == 0 (active)>",

"<NSLayoutConstraint:0x283c62d50 V:|-(6)-[_UIUCBKBSelectionBackground:0x11d085d50] (active, names: ‘|’:_UIButtonBarButton:0x11d03c690 )>",

"<NSLayoutConstraint:0x283c62df0 _UIUCBKBSelectionBackground:0x11d085d50.bottom == _UIButtonBarButton:0x11d03c690.bottom - 6 (active)>"

)

Will attempt to recover by breaking constraint

<NSLayoutConstraint:0x283c62df0 _UIUCBKBSelectionBackground:0x11d085d50.bottom == _UIButtonBarButton:0x11d03c690.bottom - 6 (active)>

thx

Same here. Did you find a solution?

no.

Although I cannot get rid of the warnings, I did found a work-around meanwhile. When I simply add a TextEditor to a dialog with nothing else added, then the keyboard issue already occurs. I traced it back all the way into the JUCE code and I found that if I use:
setWantsKeyboardFocus(true);
on the parent component, it works. So this is the dialog component itself and because I use viewport scrolling, I had to do it on the viewport as well.

It’s just so frustrating that the defaults in JUCE are all wrong it seems. Another highly irritating thing is that if you tap on the TextEditor, the caret is sometimes at the start of the text and sometimes where you tap.

1 Like

good to know, though I have no text editors - i wonder if this could be caused by combo boxes?

I’ll have a try

hasn’t helped me unfortunately.

can someone from the Juce team please comment on this? it’s been a long standing issue and any insight would be most welcome…

hi @DaveAE - did you find the code that makes the keyboard appear?

Yes, but it’s some time ago and what I wrote fixed it for me, so I didn’t look further.

If you happen to remember that would be great - I’ve search for obvious code that makes the keyboard appear but can’t find anything…

Searching is rather hopeless indeed. What I remember doing is setting a break point in the JUCE code, probably for the mousedown in Component and then trace down and down…

1 Like

interesting… if i click on a component it doesn’t happen for me - it happens for me when changing the visibility of components.

@t0m @reuk not sure who looks after the iOS stuff these days, but could they shed some light on what causes the keyboard to popup, along with where this code is in Juce so that can try and track down these issues - thx

@t0m @reuk

Please do not arbitrarily tag JUCE team members in posts. We have asked you this before. It doesn’t affect how long it will take us to investigate a particular topic.

Have you tried the previous suggestion? Set a breakpoint in a visibility changed callback and trace what’s happening.

Apologies (and I haven’t been asked this before). It is sometime frustrating for us though as we can literally go weeks/months without any comments…

I’m not sure where the keyboard component lives so I don’t know where to set the visibility changed callback.

What components? How is the visibility changing? Do the components have/grab keyboard focus?