-
Notifications
You must be signed in to change notification settings - Fork 132
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
Scroll by Row index #57
Comments
Please elaborate |
i need hightlight the row using textfield arrow key up & down. this issue i'm facing i'm able to highlight but scroll is not moving automatically to the particular row |
Still don't get it, sorry |
2021_11_22_190145.mp4scroll is not happening selected row. |
I see. Running examples on macOS doesn't seem to have the issue, arrow up/down key move row selection as well as scroll position. WIll check on Windows latter. In the meantime could you please paste here |
[✓] Flutter (Channel master, 2.6.0-12.0.pre.825, on Microsoft Windows [Version 10.0.22000.318], locale en-US) |
Flutter 2.6.0-12.0.pre.825 • channel master • https://github.com/flutter/flutter.git |
Please try stable channel, master channel is can be the reason for the issue |
i tried in stable channel still is not working |
even in web also i tried, it's not working |
What's your code? |
import 'package:data_table_2/data_table_2.dart'; /// Example without a datasource @OverRide class _DataTable2SimpleDemoState extends State { void _handleKeyEvent(RawKeyEvent event) { @OverRide |
inside datatable 2 arrow key with scroll it's working, the issue is in the textbox key handler changing the selected row by index, the row is highlighted inside datatable but scroll is not happening |
2021_11_27_194254.mp4 |
import 'package:data_table_2/data_table_2.dart'; /// Example without a datasource @OverRide class _DataTable2SimpleDemoState extends State { void _handleKeyEvent(RawKeyEvent event) { @OverRide |
sample code attached for that video and same is working with flutter datatable widget. |
Thanks for providing the sample code, can see the issue, will have a thorough look latter during the week |
any update on this? |
Investigation showed that the default implementation of keyboard events within data table and scroll view allow moving the highlighted row and scroll position without rebuilding the widget. Yet your code relies on widget rebuilding via serState() I don't have a nice solution that may avoid the rebuilds/setState(), didn't have time to dive that deep in Flutter's focus model. The workaround I can suggest you is using the scroll controller provided to the data table and set positions via it in the event handler of key strokes |
can you provide sample code |
what about the bug row background color changed black when mouse focused? |
in you provide method to change the row selected via global key then it's fine |
i have done using scrollcontroller.jumpto, issue fixed |
Can you please provide your current implementation the way you did with the example before? |
Can you tell me how to unfocus the DataTable so that the black issue can be fixed? I also faced that black issue, when navigating with arrows on the table. I used to Wrap the dataTable2 with a it's working fine, but I have a text field inside the data table, so I cannot focus the text field because of the parent |
I found a solution to this problem. if you are not using the
|
can you implement like this in datatable2, scroll by row index |
automatcially scroll vertically by row index feature need
The text was updated successfully, but these errors were encountered: