Skip to content

Commit

Permalink
fix rotation bug on segmented control (microsoft#1411)
Browse files Browse the repository at this point in the history
  • Loading branch information
harrieshin authored and huwilkes committed Dec 1, 2022
1 parent 02d29f4 commit b502999
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions ios/FluentUI/SegmentedControl/SegmentedControl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ open class SegmentedControl: UIControl {
}
button.frame = CGRect(x: leftOffset, y: 0, width: rightOffset - leftOffset, height: pillContainerView.frame.height)
leftOffset = rightOffset
button.setNeedsLayout()
}

// flipSubviewsForRTL only works on direct children subviews
Expand All @@ -437,7 +438,7 @@ open class SegmentedControl: UIControl {
if shouldSetEqualWidthForSegments {
invalidateIntrinsicContentSize()
}
layoutSubviews()
setNeedsLayout()
}

open override func sizeThatFits(_ size: CGSize) -> CGSize {
Expand Down Expand Up @@ -485,10 +486,6 @@ open class SegmentedControl: UIControl {
updateWindowSpecificColors()
}

func intrinsicContentSizeInvalidatedForChildView() {
invalidateIntrinsicContentSize()
}

/// Used to retrieve the view from the segment at the specified index
open func segmentView(at index: Int) -> UIView? {
guard index <= buttons.count else {
Expand Down

0 comments on commit b502999

Please sign in to comment.