Skip to content

Commit

Permalink
Fix PopupMenuItemCell's token sink to not overwrite custom colors (#1398
Browse files Browse the repository at this point in the history
)

* Change TVC updateAppearance to internal

* Fix PopupMenu token sink
  • Loading branch information
huwilkes committed Nov 28, 2022
1 parent ae56f02 commit 2e5cff7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions ios/FluentUI/Popup Menu/PopupMenuItemCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ class PopupMenuItemCell: TableViewCell, PopupMenuItemTemplateCell {

// until popupmenuitemcell actually supports token system, clients will override colors via cell's backgroundColor property
backgroundStyleType = .custom

tokenSetSink = tokenSet.sinkChanges { [weak self] in
guard let strongSelf = self else {
return
}
strongSelf.updateAppearance()
strongSelf.updateSelectionColors()
}
}

func setup(item: PopupMenuTemplateItem) {
Expand Down
2 changes: 1 addition & 1 deletion ios/FluentUI/Table View/TableViewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1830,7 +1830,7 @@ open class TableViewCell: UITableViewCell, TokenizedControlInternal {
updateAppearance()
}

private func updateAppearance() {
internal func updateAppearance() {
updateFonts()
updateTextColors()
updateSelectionImageColor()
Expand Down

0 comments on commit 2e5cff7

Please sign in to comment.