-
Notifications
You must be signed in to change notification settings - Fork 129
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
Fix for auto scroll issue #180
Conversation
lib/src/emoji_picker.dart
Outdated
if (widget.scrollController != null) { | ||
final autoScrollController = widget.scrollController!; | ||
autoScrollController | ||
.jumpTo(autoScrollController.position.maxScrollExtent); | ||
} | ||
|
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.
Would it make sense to put it after widget.onEmojiSelected?.call(category, emoji);
because if someone uses TextInputController
in onEmojiSelected
with then it wouldn't scroll? Same question with widget.onBackspacePressed?.call();
above
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.
I made a commit to version 2.0 addressing the same issue based on your code.
If you want to add the feature to v1.x of the emoji picker then it would be nice if you could check my commit and adjust your PR.
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.
Would it make sense to put it after
widget.onEmojiSelected?.call(category, emoji);
because if someone usesTextInputController
inonEmojiSelected
with then it wouldn't scroll? Same question withwidget.onBackspacePressed?.call();
above
Yes, Indeed you are right. I have update the PR based on your changes in version 2.0
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.
Thanks for quick response ! Sorry, but I had to added another fix to it, would be great if you could include them as well. 8e4a287
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.
@Fintasys I have updated the PR. Please review it. Thanks :)
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.
Thanks for making all the changes and your contribution ! I think it looks good now 👍
closes: #179
Usage Example:
Create a new ScrollController and pass it to TextField and EmojiPicker :
Reference: https://stackoverflow.com/questions/71408717/flutter-textfield-content-does-not-scroll-automatically-when-inserting-text