Make the combo row a bit safer

This commit is contained in:
david-swift 2024-01-04 16:14:18 +01:00
parent 853555a9fc
commit 5a625e31a7

View File

@ -74,7 +74,7 @@ where Element: CustomStringConvertible, Element: Identifiable, Element: Equatabl
}
update(row: row)
_ = row.onChange {
if let element = content.first(where: { $0.description == row.selected() }) {
if let element = content.first(where: { $0.description == row.selected() }), element.id != selection {
selection = element.id
}
}