Skip to content

Bug when recycling SliderCell #31

@lucastac

Description

@lucastac

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();

    ...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions