Fix GridLayout resize after removing caption (#12011)

Change-Id: Ieda9b23a1cbf6700cc7438d0b404c3229dd27ed8