Open piuskamil opened 3 years ago
This is probably a focus issue due to a rebuild.
I'm sure I don't have focus on that field. Or do u mean updateAndValidity set focus on that field somehow ?
Or do u mean updateAndValidity set focus on that field somehow ?
No, not intentionally, but it causes a rebuild of the widget and that might focus the next untouched field or something.
Ok maybe. I will try some kind of unfocus thing. Like
FocusScope.of(context).unfocus();
Or maybe unfocus control after updateAndValidity.
I have tried everything. No luck yet
@piuskamil there is a corresponding flutter issue for such behaviour https://github.com/flutter/flutter/issues/50713#issuecomment-620098640
I didn't check if it realy fixed.
Here is my reproduction repo https://github.com/artflutter/flutter_issue_50713
I've just tried my own repo)
This fix does not present in 2.0.4 But present in 2.1.0-13.0.pre.479
@piuskamil did you succeed in fixing the issue?
@vasilich6107 partly, I have used listview builder to split my form and lazy load hidden parts of the form and this issue no longer occurs
Hi. I'm not sure it's directly connected with reactive_forms plugin. In my case I have very complicated, nested (3 level) form with multiple listeners to show hide controls and custom validators. And it's generated from json configuration. It was easy to rewrite my angular implementation to flutter, thank you for that plugin :) But there is strange behavior. After I select a radio button and manually do updateAndValidity on other form control which validation depends on that radio button then suddenly my screen scrolls to that field. And it's happens only once at first updateAndValidity. If i set emitEvent on false then scroll not change but my validation message is not visible. I'm not sure what is happening.