The current positioning heuristic will anchor the keyboard to the closest edge of the screen and maintain the same distance when you change orientation. However, if you have a keyboard centered in a short and wide screen and then rotate the orientation, this creates a somewhat unexpected result.
For a simplified example, imagine a 600 x 300 screen with a keyboard that is 200 pixels wide. If this keyboard is centered in the bottom of the screen, my expectation is that when I rotate the screen to 300 x 600, it'll still be centered, 50 pixels from the left and right sides and touching the bottom. Instead, it is anchored to the right side with a margin of 200 pixels. The end result of this is that the keyboard gets pushed all the way to the bottom left corner (luckily valid bounds are ensured so that it doesn't actually get pushed off the left side).
A possibly better heuristic is to maintain this information in the form of a ratio between left and right padding rather than strict pixel count. A keyboard anchored in the corner will still be in the same corner, although the pixel-count of the padding might change a bit, but a centered keyboard will stay centered.
Comment 1 by bugdroid1@chromium.org
, Feb 28 2018