How to position according to the AnchorPoint with AutomaticSize?

I am using frames with AutomaticSize inside of a grid layout, which works fine at its normal size. However, when they are resized, they resize in all directions. Setting the anchor points of the frames did not work. How can I achieve this?
(current result)

(result needed)

You can truncate the text at the end. Alternatively, if you want every item to scale downwards with the text, insert a UIListLayout into the frame.