Text positioning issue

Sometimes when I build up a block of UI with a textmesh pro block of text the text isn’t positioned correctly.
In the editor the “containment rectangle” is shown in the correct place but the text is misplaced to the side of it.

When this has happened then whilst in the editor modifying any field in the Text Mesh Pro UGUI component will cause the text to instantly position itself correctly.
Modifying position or any anchor in the Rect Transform component will also instantly fix the issue (scale and rotate whilst working don’t - although ctrl-z to undo the changes does).

At the moment I’ve got around it by adding a call to TextMeshProUGUI.SetAllDirty() although I suspect this isn’t particularly efficient particularly as I have a lot of text and can’t discriminate between text that works and text that doesn’t.

I also noticed that in these cases preferredHeight and preferredWidth return incorrect values whilst GetPreferredValues returns the correct ones.

I suspect I’m doing something a little “out of sequence” which is managing to confuse the dirty flags for the text but at the moment I’m struggling to figure out what.

I should add I’m using Unity 2018.3.11f1 and have tried TMP versions 1.3.0, 1.4.1 & 1.5.0 preview with the same results.

I suspect you might have modified the Margins of the text container. See if the values in the Extra Settings are something other than zero.

I’ve checked these and they’re all set at 0 (as per your screenshot) - changing them is the same as modifying anything in the component in that it forces the text to redraw at the correct position.
(Even adding a ‘-’ in front of the zero will ‘fix’ the issue).

Can you post some images of what you are seeing vs. what you expect?