From 30b8885f5d563b3a0b32f0c42a203900c2065340 Mon Sep 17 00:00:00 2001 From: Lukas Capkovic <3610850+lcapkovic@users.noreply.github.com> Date: Wed, 17 Jul 2024 11:31:48 -0700 Subject: [PATCH] New method for separator hiding (#2068) --- ios/FluentUI/Other Cells/ActionsCell.swift | 6 +++--- ios/FluentUI/Table View/TableViewCell.swift | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ios/FluentUI/Other Cells/ActionsCell.swift b/ios/FluentUI/Other Cells/ActionsCell.swift index 2d3a78454..8d18aed6c 100644 --- a/ios/FluentUI/Other Cells/ActionsCell.swift +++ b/ios/FluentUI/Other Cells/ActionsCell.swift @@ -187,9 +187,9 @@ open class ActionsCell: UITableViewCell, TokenizedControlInternal { // A hacky way to hide the system separator by squeezing it just enough to have zero width. // This is the only known way to hide the separator without making the UITableView do it for us. let boundsWidth = bounds.width - if separatorInset.left != boundsWidth || separatorInset.right != 0 { - separatorInset.left = boundsWidth - separatorInset.right = 0 + let targetSystemSeparatorInset = UIEdgeInsets(top: 0, left: boundsWidth, bottom: 0, right: 0) + if separatorInset.left < boundsWidth { + separatorInset = targetSystemSeparatorInset } layoutHorizontalSeparator(topSeparator, with: topSeparatorType, at: 0) diff --git a/ios/FluentUI/Table View/TableViewCell.swift b/ios/FluentUI/Table View/TableViewCell.swift index b8220538f..cd34e90ef 100644 --- a/ios/FluentUI/Table View/TableViewCell.swift +++ b/ios/FluentUI/Table View/TableViewCell.swift @@ -1444,9 +1444,9 @@ open class TableViewCell: UITableViewCell, TokenizedControlInternal { // A hacky way to hide the system separator by squeezing it just enough to have zero width. // This is the only known way to hide the separator without making the UITableView do it for us. let boundsWidth = bounds.width - if separatorInset.left != boundsWidth || separatorInset.right != 0 { - separatorInset.left = boundsWidth - separatorInset.right = 0 + let targetSystemSeparatorInset = UIEdgeInsets(top: 0, left: boundsWidth, bottom: 0, right: 0) + if separatorInset.left < boundsWidth { + separatorInset = targetSystemSeparatorInset } layoutSeparator(topSeparator, with: topSeparatorType, at: 0)