UnityDebugSheet icon indicating copy to clipboard operation
UnityDebugSheet copied to clipboard

Bug when recycling SliderCell

Open lucastac opened this issue 6 months ago • 0 comments

Recycling a SliderCell triggers the "value changed event" in different properties when typing the value, instead of sliding the slider.

Proposed fix:

--- a/Assets/UnityDebugSheet/Runtime/Core/Scripts/DefaultImpl/Cells/SliderPickerCell.cs
+++ b/Assets/UnityDebugSheet/Runtime/Core/Scripts/DefaultImpl/Cells/SliderPickerCell.cs

protected override void SetModel(SliderCellModel model)
{
    _contentsCanvasGroup.alpha = model.Interactable ? 1.0f : 0.3f;
    
    // Cleanup
    valueField.onValueChanged.RemoveAllListeners();
+   valueField.onEndEdit.RemoveAllListeners();
    slider.onValueChanged.RemoveAllListeners();

    ...
}

lucastac avatar Jun 27 '25 15:06 lucastac