setOnSpinnerOutsideTouchListener does not fire
See original GitHub issuePlease complete the following information:
- Library Version [e.g. v1.0.0] : 1.0.5
- Affected Device(s) : Google Pixel 3a
Describe the Bug:
Im using Kotlin with PowerSpinner, setting the onSpinnerOutsideTouchListener using setOnSpinnerOutsideTouchListener { view, motionEvent -> }
does not get fired while touching outside spinner when the spinner is open
Expected Behavior:
Expect to get event fired when touching outside spinner when the spinner is open, so that I could close the spinner. It would be good if the spinner could be closed when user click the physical back button.
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
Android Spinner setOnItemSelectedListener does not fire ...
I download data from API using Volley and put it into Spinner. I can see all items that I get from API. However...
Read more >PowerSpinner - 🌀 A lightweight dropdown popup spinner, ...
If the popup is not showing, shows the spinner popup menu. // If the popup is already ... setOnSpinnerOutsideTouchListener does not fire.
Read more >A lightweight dropdown popup spinner with fully customizable ...
Here is a basic example of implementing PowerSpinnerView in XML layout. ... setOnClickListener { } // the spinner popup will not be dismissed...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@skydoves There is a side-issue produced by this
setOnSpinnerItemSelectedListener
fix. If you click on thePowerSpinnerView
it will shows the dropdown, clicking one more time should dismiss the dropdown.The intention to add a
setOnSpinnerOutsideTouchListener
is to dismiss the dropdown while click was being detected outside the dropdown, to implement is to calldismiss()
in the callback function. However, by adding asetOnSpinnerOutsideTouchListener
, clicking on thePowerSpinnerView
when dropdown is showing will fireshowOrDismiss
twice ifdismiss()
is being called withinsetOnSpinnerOutsideTouchListener {}
, resulting unable to dismiss thePowerSpinnerView
dropdown by clicking it again.One quick fix on my side is to add some handling like below to override the
onClickListener
:See if you could handle it within the library. Thanks.
It is released on the new version
1.0.8
! And you can set the new attributedebounce_duration
.