diff --git a/src/main/java/tornadofx/ListView.kt b/src/main/java/tornadofx/ListView.kt index 482cffa25..70ffb0112 100644 --- a/src/main/java/tornadofx/ListView.kt +++ b/src/main/java/tornadofx/ListView.kt @@ -142,11 +142,7 @@ open class SmartListCell(val scope: Scope = FX.defaultScope, listView: ListVi super.updateItem(item, empty) if (item == null || empty) { - textProperty().unbind() - graphicProperty().unbind() - text = null - graphic = null - style = null + cleanUp() clearCellFragment() } else { FX.ignoreParentBuilder = Once @@ -170,6 +166,15 @@ open class SmartListCell(val scope: Scope = FX.defaultScope, listView: ListVi } } + private fun cleanUp() { + textProperty().unbind() + graphicProperty().unbind() + text = null + graphic = null + style = null + styleClass.clear() + } + private fun clearCellFragment() { cellFragment?.apply { cellProperty.value = null