Fix selection when resizing the component.