Skip to content

Commit 6517426

Browse files
authored
Update CommandBar to clip to bounds (#2237)
1 parent 64b2773 commit 6517426

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Sources/FluentUI_iOS/Components/CommandBar/CommandBar.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ public class CommandBar: UIView, Shadowable, TokenizedControl {
9999
commandBarContainerStackView.axis = .horizontal
100100
commandBarContainerStackView.translatesAutoresizingMaskIntoConstraints = false
101101
commandBarContainerStackView.isLayoutMarginsRelativeArrangement = true
102+
commandBarContainerStackView.clipsToBounds = true
102103

103104
super.init(frame: .zero)
104105

@@ -151,7 +152,10 @@ public class CommandBar: UIView, Shadowable, TokenizedControl {
151152
public override func layoutSubviews() {
152153
super.layoutSubviews()
153154

154-
layer.cornerRadius = bounds.height / 2
155+
let cornerRadius = bounds.height / 2
156+
layer.cornerRadius = cornerRadius
157+
commandBarContainerStackView.layer.cornerRadius = cornerRadius
158+
155159
updateShadow()
156160
updateScrollViewShadow()
157161
}

0 commit comments

Comments
 (0)