Fixed place error when not enough space under

When there is not enough space between input and bottom of window, input will display above input instead. But the position should be top of input reduce height of widget.