-
Notifications
You must be signed in to change notification settings - Fork 99
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
bugfix: close keyboard on scroll #162
bugfix: close keyboard on scroll #162
Conversation
Co-authored-by: Serge Shkurko <shkurko@thekey.space>
* downgrade intl * fix cursor color * fix panel height * enlarge prefix hit area
… form and both lists had results
* feature: search by submitting form * bugfix: fixed issue where it would double pop the route if submitting form and both lists had results
This is a fantastic UX improvement. Thanks |
lib/src/widgets/country_selector/country_selector_navigator.dart
Outdated
Show resolved
Hide resolved
… bugfix/close_keyboard_on_scroll
@@ -40,6 +40,15 @@ class PhoneFieldState extends State<PhoneField> { | |||
SystemChannels.textInput.invokeMethod('TextInput.show'); | |||
} | |||
|
|||
// TODO: Would be cleaner if we could infer it from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be a fix for another issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, you're right. My mistake merging it in here.
Same as for the other PR Let's add a test and remove the part that's for another PR please. This is a great addition but I have to require some test solidity for my own sanity. Will merge as soon as that's done. |
@cedvdb I don't have any experience with writing such tests in Flutter unfortunately, and very limited on time these days, would learn a lot by seeing someone else present how such a frontend test could look like. |
There are tests in the test folder. A test that verifies that when scrolling the keyboard is not shown anymore would be good. Essentially something like the pseudo code testWidgets('Should hide keyboard on scroll', (widgetTester) {
await widgetTester.pumpWidget( country-selector-widget );
await widgetTester.pumpAndSettle();
// test that the keyboard is shown initially
expect(tester.testTextInput.isVisible, isTrue);
await widgetTester.scroll(...);
await widgetTester.pumpAndSettle();
// check that the keyboard is not shown anymore
expect(tester.testTextInput.isVisible, isFalse);
}); |
|
||
// detect length difference | ||
final diff = e.length - _previousValue.length; | ||
if (diff > 3) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note that this change seems to be for another PR.
@simplenotezy Is the comment above clear enough to go forward with the test ? |
* fix: disable country chip when field is disabled (#202) * fix: disable country chip when field is disabled * fixup! fix: disable country chip when field is disabled * fixup! fixup! fix: disable country chip when field is disabled * add ku and ckb translations (#209) * fix: copy/paste wasn't possible due to context menu builder being passed as null (#198) Co-authored-by: Mattias Siø Fjellvang <mattias@doubble.dk> * bugfix: close keyboard on scroll (#162) * Supported safe area in bottom sheet of country selector (#153) Co-authored-by: Serge Shkurko <shkurko@thekey.space> * update intl to 18.0 (#156) * 7.0.6 * Fix search cursor color and initial bottom sheet height (#157) * downgrade intl * fix cursor color * fix panel height * enlarge prefix hit area * added cursor fix * revert changes from incorrect pr * feature: allow searching by ISO code * feature: search by submitting form * bugfix: fixed issue where it would double pop the route if submitting form and both lists had results * feature: search by submitting form (#160) * feature: search by submitting form * bugfix: fixed issue where it would double pop the route if submitting form and both lists had results * feature: allow searching by ISO code (#161) * bugfix: hide the keyboard when scrolling list, so it doesn't overlap * feature: use autofill hints for search input * feature: auto-submit when autofilling/pasting country * refactor: move change handler into seperate method * refactor: fixed deprecated window usage * fix: copy/paste wasn't possible due to context menu builder being passed as null * fix: remove listener on dispose --------- Co-authored-by: Serge Shkurko <sergeshkurko@outlook.com> Co-authored-by: Serge Shkurko <shkurko@thekey.space> Co-authored-by: zitob9 <elias.housni@gmail.com> Co-authored-by: cedvdb <cedvandenbosch@gmail.com> Co-authored-by: cizmarf <37090294+cizmarf@users.noreply.github.com> Co-authored-by: Mattias Siø Fjellvang <mattias@doubble.dk> * feature: autofill country (#163) * Supported safe area in bottom sheet of country selector (#153) Co-authored-by: Serge Shkurko <shkurko@thekey.space> * update intl to 18.0 (#156) * 7.0.6 * Fix search cursor color and initial bottom sheet height (#157) * downgrade intl * fix cursor color * fix panel height * enlarge prefix hit area * added cursor fix * revert changes from incorrect pr * feature: allow searching by ISO code * feature: search by submitting form * bugfix: fixed issue where it would double pop the route if submitting form and both lists had results * feature: search by submitting form (#160) * feature: search by submitting form * bugfix: fixed issue where it would double pop the route if submitting form and both lists had results * feature: allow searching by ISO code (#161) * bugfix: hide the keyboard when scrolling list, so it doesn't overlap * feature: use autofill hints for search input * feature: auto-submit when autofilling/pasting country * refactor: move change handler into seperate method * refactor: fixed deprecated window usage * fix: copy/paste wasn't possible due to context menu builder being passed as null * fix: remove listener on dispose --------- Co-authored-by: Serge Shkurko <sergeshkurko@outlook.com> Co-authored-by: Serge Shkurko <shkurko@thekey.space> Co-authored-by: zitob9 <elias.housni@gmail.com> Co-authored-by: cedvdb <cedvandenbosch@gmail.com> Co-authored-by: cizmarf <37090294+cizmarf@users.noreply.github.com> Co-authored-by: Mattias Siø Fjellvang <mattias@doubble.dk> * feat: add ability to customise search delegate app bar theme (#208) * Refactor (#212) * fix merge issue * remove generated files from git * saving * refactor * improve search ux * refactor * saving * refactor * rm * upgrade flag cache * cache * saving * refa * refactor * comment * validation * moving tests * saving * language * fixing tests * fix tests * saving * saving * saving * fix all tests * External country selector (#213) * fix merge issue * remove generated files from git * saving * refactor * improve search ux * refactor * saving * refactor * rm * upgrade flag cache * cache * saving * refa * refactor * comment * validation * moving tests * saving * language * fixing tests * fix tests * saving * saving * saving * fix all tests * localization * readd example * localization * dart fix * external country selector * cc --------- Co-authored-by: Tautvydas Šidlauskas <tautvydas.sidlauskas@gmail.com> Co-authored-by: Ahmad Najm <86409804+ahmadnajmdev@users.noreply.github.com> Co-authored-by: Mattias Fjellvang <simplenotezy@users.noreply.github.com> Co-authored-by: Mattias Siø Fjellvang <mattias@doubble.dk> Co-authored-by: Serge Shkurko <sergeshkurko@outlook.com> Co-authored-by: Serge Shkurko <shkurko@thekey.space> Co-authored-by: zitob9 <elias.housni@gmail.com> Co-authored-by: cizmarf <37090294+cizmarf@users.noreply.github.com>
* fix: disable country chip when field is disabled (#202) * fix: disable country chip when field is disabled * fixup! fix: disable country chip when field is disabled * fixup! fixup! fix: disable country chip when field is disabled * add ku and ckb translations (#209) * fix: copy/paste wasn't possible due to context menu builder being passed as null (#198) Co-authored-by: Mattias Siø Fjellvang <mattias@doubble.dk> * bugfix: close keyboard on scroll (#162) * Supported safe area in bottom sheet of country selector (#153) Co-authored-by: Serge Shkurko <shkurko@thekey.space> * update intl to 18.0 (#156) * 7.0.6 * Fix search cursor color and initial bottom sheet height (#157) * downgrade intl * fix cursor color * fix panel height * enlarge prefix hit area * added cursor fix * revert changes from incorrect pr * feature: allow searching by ISO code * feature: search by submitting form * bugfix: fixed issue where it would double pop the route if submitting form and both lists had results * feature: search by submitting form (#160) * feature: search by submitting form * bugfix: fixed issue where it would double pop the route if submitting form and both lists had results * feature: allow searching by ISO code (#161) * bugfix: hide the keyboard when scrolling list, so it doesn't overlap * feature: use autofill hints for search input * feature: auto-submit when autofilling/pasting country * refactor: move change handler into seperate method * refactor: fixed deprecated window usage * fix: copy/paste wasn't possible due to context menu builder being passed as null * fix: remove listener on dispose --------- Co-authored-by: Serge Shkurko <sergeshkurko@outlook.com> Co-authored-by: Serge Shkurko <shkurko@thekey.space> Co-authored-by: zitob9 <elias.housni@gmail.com> Co-authored-by: cedvdb <cedvandenbosch@gmail.com> Co-authored-by: cizmarf <37090294+cizmarf@users.noreply.github.com> Co-authored-by: Mattias Siø Fjellvang <mattias@doubble.dk> * feature: autofill country (#163) * Supported safe area in bottom sheet of country selector (#153) Co-authored-by: Serge Shkurko <shkurko@thekey.space> * update intl to 18.0 (#156) * 7.0.6 * Fix search cursor color and initial bottom sheet height (#157) * downgrade intl * fix cursor color * fix panel height * enlarge prefix hit area * added cursor fix * revert changes from incorrect pr * feature: allow searching by ISO code * feature: search by submitting form * bugfix: fixed issue where it would double pop the route if submitting form and both lists had results * feature: search by submitting form (#160) * feature: search by submitting form * bugfix: fixed issue where it would double pop the route if submitting form and both lists had results * feature: allow searching by ISO code (#161) * bugfix: hide the keyboard when scrolling list, so it doesn't overlap * feature: use autofill hints for search input * feature: auto-submit when autofilling/pasting country * refactor: move change handler into seperate method * refactor: fixed deprecated window usage * fix: copy/paste wasn't possible due to context menu builder being passed as null * fix: remove listener on dispose --------- Co-authored-by: Serge Shkurko <sergeshkurko@outlook.com> Co-authored-by: Serge Shkurko <shkurko@thekey.space> Co-authored-by: zitob9 <elias.housni@gmail.com> Co-authored-by: cedvdb <cedvandenbosch@gmail.com> Co-authored-by: cizmarf <37090294+cizmarf@users.noreply.github.com> Co-authored-by: Mattias Siø Fjellvang <mattias@doubble.dk> * feat: add ability to customise search delegate app bar theme (#208) * fix merge issue * remove generated files from git * saving * refactor * improve search ux * refactor * saving * refactor * rm * upgrade flag cache * cache * saving * refa * refactor * comment * validation * moving tests * saving * language * fixing tests * fix tests * saving * saving * saving * fix all tests * Refactor (#212) * fix merge issue * remove generated files from git * saving * refactor * improve search ux * refactor * saving * refactor * rm * upgrade flag cache * cache * saving * refa * refactor * comment * validation * moving tests * saving * language * fixing tests * fix tests * saving * saving * saving * fix all tests * localization * readd example * localization * dart fix * external country selector * cc * External country selector (#213) * fix merge issue * remove generated files from git * saving * refactor * improve search ux * refactor * saving * refactor * rm * upgrade flag cache * cache * saving * refa * refactor * comment * validation * moving tests * saving * language * fixing tests * fix tests * saving * saving * saving * fix all tests * localization * readd example * localization * dart fix * external country selector * cc * dart fix * bump version * External country selector (#215) * fix merge issue * remove generated files from git * saving * refactor * improve search ux * refactor * saving * refactor * rm * upgrade flag cache * cache * saving * refa * refactor * comment * validation * moving tests * saving * language * fixing tests * fix tests * saving * saving * saving * fix all tests * localization * readd example * localization * dart fix * external country selector * cc * dart fix * bump version * mv --------- Co-authored-by: Tautvydas Šidlauskas <tautvydas.sidlauskas@gmail.com> Co-authored-by: Ahmad Najm <86409804+ahmadnajmdev@users.noreply.github.com> Co-authored-by: Mattias Fjellvang <simplenotezy@users.noreply.github.com> Co-authored-by: Mattias Siø Fjellvang <mattias@doubble.dk> Co-authored-by: Serge Shkurko <sergeshkurko@outlook.com> Co-authored-by: Serge Shkurko <shkurko@thekey.space> Co-authored-by: zitob9 <elias.housni@gmail.com> Co-authored-by: cizmarf <37090294+cizmarf@users.noreply.github.com>
A minor update, that hides the keyboard when scrolling the list:
RPReplay_Final1677107102.MP4