If the selected element doesn't fit, we selected a new one with a width equal to the available space with as much height as possible. We need to make a fix if the available width doesnt have any matching dimensions passed in.