Fix list element selection in code causing crash

This commit is contained in:
david-swift 2024-05-18 14:57:40 +02:00
parent 239f025508
commit c07b0718f7

View File

@ -40,7 +40,8 @@ extension List {
storage.connectSignal(name: "selected_rows_changed", id: Self.selectionField) {
if let binding = storage.fields[Self.selectionField] as? Binding<Element.ID>,
let elements = storage.fields[Self.elementsField] as? [Element],
let id = id(storage, elements) {
let id = id(storage, elements),
binding.wrappedValue != id {
binding.wrappedValue = id
}
}