Unfortunately, I don’t see how your component is made, but I can assume that you didn’t add Auto Layout to it.
See examples of how to do this: