question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Slider] When select a value not drag the slider ,the onChange method doesn't notify

See original GitHub issue

Description: When I update the libray from com.google.android.material:material:1.2.0-alpha02 to com.google.android.material:material:1.2.0-alpha03, but when I select a new value the tooltip didn’t show and the method of onChange didn’t work,the same problem occur in the catalog

Expected behavior: it should working like 1.20-alpha02

Source code:

   <com.google.android.material.slider.Slider
                        android:id="@+id/slide"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
            
                       />
        slide.valueFrom = 0f
        slide.valueTo = 20f
        slide.stepSize = 1f

 slide.setOnChangeListener { slider, value ->
            //do something
        }

Android API version: Android Q

Material Library version: com.google.android.material:material:1.2.0-alpha03

Device: oneplus 6

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
cketchamcommented, Dec 30, 2019

In 1.2.0-alpha03 we added a fix to prevent the Slider from intercepting scroll events from the parent. It looks like in this case it’s no longer dispatching the change because we avoid handling the touch event unless there is enough horizontal movement. I’ll take a look.

0reactions
s7aycoolcommented, May 27, 2020

I also can’t set slider to a value by selecting it. New value is selected only when I drag of swipe the slider. 1.2.0-alpha06

Read more comments on GitHub >

github_iconTop Results From Across the Web

onchange event on input type=range is not triggering in ...
This reads the slider as needed, but continues firing unnecessarily during any mouse-over events, even when the user has not clicked and is...
Read more >
Event triggered when the slider value changes (no drag)
Hello, Is there an event triggered when the value of a slider changes? In the above example, the alert("in") method is never called....
Read more >
onchange vs. oninput for Range Sliders - Impressive Webs
The change event does not fire immediately, demonstrated by the fact that the value on the page does not change until the slider...
Read more >
Slider class - material library - Flutter - Dart API docs
The "value indicator", which is a shape that pops up when the user is dragging the thumb to indicate the value being selected....
Read more >
How to trigger onchange event on input type=range while ...
It is a frequent UI design for a range slider to showcase the immediate change in the depicted value as the user moves...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found