For some strange reason, clicking the segments on the bottom of the slider works correctly, but sliding the slider from point to point does not update the value of the slider consistantly, it seems to be delayed (it displays the previous value, not the current value.)
It’s acting like sliding it doesn’t trigger the on-change event when it should actually fire.
I don’t quite understand the problem. And I don’t understand from the screenshots what is working wrong. Can you record a video and demonstrate what is not working correctly?
@Inna_Shkolnaya
Notice that when the slider is slid from point-to-point that the value below the slider is not the same as the value of the slider that’s displayed in the slider’s value bubble.
On the other hand, when the segments are clicked, the value of the slider matches the value in the bubble of the slider.
I suggest adding some “print” statements into your logic to debug this further. If your logic shows “Eight” while the slider has “9” selected, it means the “Content Logic” was not triggered. The triggering of that logic would occur when the underlying data model changes. It changes when you update data in it.
Here’s why it works in my case:
When the slider changes (dragging or clicking) - it updates its data model. That update triggers all other content handlers that use the same data model, including Content Logic of the text label. As a result, my content logic always has the most current value of the slider.
Here’s why it doesn’t always work for you:
Your Content Logic goes directly into the component to get its value. As I wrote earlier, the Content Logic is triggered when the underlying model changes, in your case, there is no explicit or implicit change event of the data model.
One thing that I notice is that when clicking on the segments, only one event is triggered.
When sliding the slider, about 46 events are triggered in between the segments.
So answer this: Why does it work correctly when clicking on the segments and not work correctly when dragging the control? (Which was my original question )
An answer to this question would be in the data binding mappings you have in the app. The rule of thumb is - any handler (such as Content Logic) is invoked when the underlying data model changes. This is the reason why in my demo I channel slider changes through the data model. The reason why your content handler is not triggered is that the data model is not updated.