New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A discrete RangeSlider is not draggable inside a ListView. #51620
Comments
Hi @serhii-k |
Hi @VladyslavBondarenko
And a recording: |
By the way, I've also added onChangeStart and onChangeEnd callbacks. And here's the output (following this video): So even for the last two correct attempts, there are unnecessary intermediate callbacks. |
@serhii-k |
A temporary workaround.
This is just a temporary solution. When in a scrollable parent, there is some issue with gesture recognizers inside the _RenderRangeSlider class. Notice: this solution triggers some unnecessary intermediate calls to onChangeEnd() and onChangeStart() (_tap.onTapCancel followed by _drag.onStart). |
I think I'm having the same issue. RangeSlider in a Scrollable parent is such a common use case. I can't believe it still exists in 1.17 "Stable". |
I'm still having this problem in: |
Still having this prob! |
Commenting to add visibility to this issue. |
Hi @serhii-k, I verified the issue on the latest master 3.7 and it doesn't seem to reproduce. I believe the bug is fixed. Screen.Recording.2023-01-03.at.9.27.01.PM.movcode sampleimport 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
static const String _title = 'Flutter Code Sample';
@override
Widget build(BuildContext context) {
return MaterialApp(
title: _title,
home: Scaffold(
appBar: AppBar(title: const Text(_title)),
body: const SimpleTest(),
),
);
}
}
class SimpleTest extends StatelessWidget {
const SimpleTest({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: ListView(
padding: const EdgeInsets.only(top: 100.0),
children: const <Widget>[
RangeTest(),
],
),
);
}
}
class RangeTest extends StatefulWidget {
const RangeTest({super.key});
@override
_RangeTestState createState() => _RangeTestState();
}
class _RangeTestState extends State<RangeTest> {
var _values = const RangeValues(2.0, 8.0);
@override
Widget build(BuildContext context) {
return RangeSlider(
values: _values,
onChanged: (rangeValues) => setState(() {
_values = rangeValues;
}),
min: 0.0,
max: 10.0,
divisions: 10,
);
}
}
flutter doctor -v (mac)
cc: @koodimetsa Closing as this is no longer reproducible, Incase anyone still encounters the issue, then please feel free to write in the comments and we will reopen it. Thank you. |
@maheshmnj In this case RangeSlider doesn't work reliably. |
@koodimetsa were you able to reproduce with the code sample I shared? |
@maheshmnj Yes, I used that code sample 👍🏼 It seems, that if the touch event starts from "inside" of the range slider, the drag event abruptly ends. Here is a video with an example: Screen.Recording.2023-01-25.at.17.22.51.mov |
Thanks for the update @koodimetsa, I was able to reproduce the issue on stable 3.7 and the master channel. Screen.Recording.2023-01-26.at.3.13.33.PM.movflutter doctor -v
|
A RangeSlider is awesome. But when its discrete version is put inside a ListView, an annoying bug arises. For simplicity, let's say we're using the Left-to-Right directionality.
The text was updated successfully, but these errors were encountered: