Skip to main content
Inspiring
June 8, 2015
Question

changing orientation on a device with focused textfield

  • June 8, 2015
  • 1 reply
  • 427 views

If I have a selected text field that is below the keyboard, the app will slide up with the keyboard. If i rotate the device with that textfield still selected, the app slides up even further and unselecting the keyboard will not place the app back to its zero position.

Is this an unknown bug?

I have tried a few workarounds with no success

One being to, on an orientation change event, to lose the focus, wait a second then refocus.  But setting stage.focus to null doesn't close the keyboard while rotating unfortunately

This topic has been closed for replies.

1 reply

sinious
Legend
June 8, 2015

Are you doing anything to capture the orientation change event to modify your layout?

If you're using a very simple layout that works in both orientations then your workaround sounds ideal for now but I can see how drastically resizing a container is going to skew content around. If I were you I would be handling that orientation change manually anyhow.

For the record I've been in the search box of many apps before, changed orientation to type easier in portrait, and lost the search box entirely.

BDanisAuthor
Inspiring
June 8, 2015

I tried listening to orientation change and orientation changing. the workaround doesn't work though, it seems that as the app is rotating, the focus = null doesn't do anything.  Even on a stage text.

unfortunately at times, the textboxes have to be in the unsafe zones.

sinious
Legend
June 8, 2015

Try focusing the stage itself rather than null.