slovnicki / beamer

A routing package built on top of Router and Navigator's pages API, supporting arbitrary nested navigation, guards and more.
MIT License
591 stars 129 forks source link

TextField is getting focus after calling Navigator.pop and using beamer #610

Closed IlyaMax closed 1 year ago

IlyaMax commented 1 year ago

TextField is getting focus if it was previously focused after calling Navigator.pop and using beamer

version 1.5.3

Minimal reproducable example: https://github.com/IlyaMax/flutter_playground/tree/text-field-focus-when-pop-ios-issue Steps for iOS:

  1. Focus one of field.
  2. Hide keyboard with drag
  3. Go to the next page by tapping FAB
  4. Navigate back by tapping FAB on green screen Actual behavior Your textfield is getting focus

Expected behavior Your textfield is not getting focus

Steps for Android:

  1. Focus one of field.
  2. Go to the next page by tapping FAB
  3. Navigate back by tapping FAB on green screen Actual behavior Your textfield is getting focus

Expected behavior Your textfield is not getting focus

IlyaMax commented 1 year ago

Interesting that it can be reproduced with go router too. Maybe the issue with MaterialApp.router constructor https://github.com/IlyaMax/flutter_playground/tree/text-field-focus-when-pop-ios-issue-go-router Not reproduced with MaterialApp constructor https://github.com/IlyaMax/flutter_playground/tree/text-field-focus-when-pop-ios-issue-not-router

IlyaMax commented 1 year ago

https://github.com/flutter/flutter/issues/124778 close this because seems like that is an issue of flutter