Skip to content

Commit 610c997

Browse files
loading-googlematerial-automation
authored andcommitted
[Dialogs] Fix issue where the line break mode is set on the wrong title label. It should be set on the M3CButton's titleLabel, instead it is set on the dialog's titleLabel.
PiperOrigin-RevId: 704766381
1 parent decc506 commit 610c997

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

components/Dialogs/src/private/MDCAlertControllerView+Private.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1063,6 +1063,7 @@ - (void)layoutHorizontalButtons:(NSArray<UIButton *> *)buttons actionSize:(CGSiz
10631063
M3CButton *m3cButton = (M3CButton *)button;
10641064
if (m3cButton.textCanWrap) {
10651065
m3cButton.textCanWrap = false;
1066+
m3cButton.titleLabel.lineBreakMode = NSLineBreakByTruncatingMiddle;
10661067
m3cButton.titleLabel.preferredMaxLayoutWidth = 0;
10671068
}
10681069
}
@@ -1129,7 +1130,7 @@ - (void)layoutVerticalButtons:(NSArray<UIButton *> *)buttons {
11291130
if (self.isM3CButtonEnabled && [button isKindOfClass:M3CButton.class]) {
11301131
M3CButton *m3cButton = (M3CButton *)button;
11311132
m3cButton.textCanWrap = YES;
1132-
self.titleLabel.lineBreakMode = NSLineBreakByTruncatingMiddle;
1133+
m3cButton.titleLabel.lineBreakMode = NSLineBreakByTruncatingMiddle;
11331134
m3cButton.titleLabel.preferredMaxLayoutWidth = maxButtonWidth;
11341135
}
11351136
CGRect buttonRect = button.bounds;

0 commit comments

Comments
 (0)