henryleunghk / flutter-native-text-input

Native text input for Flutter
MIT License
66 stars 50 forks source link

Max height should be an integer number of lines #32

Open collinjackson opened 2 years ago

collinjackson commented 2 years ago

You can have a line be partially visible if you're overflowing the container.

This video is based on the demo code in https://github.com/indjec/native-text-field

https://user-images.githubusercontent.com/394889/159553998-03b6b19b-12bf-4a68-acb7-e759470fe05e.mov

It seems to be some issue with the computation of _maxHeight.

In my testing, adding 13 to the value of maxLineHeight helped. Here's a code sample:

https://github.com/collinjackson/flutter-native-text-input/tree/padding-fix

After the change:

https://user-images.githubusercontent.com/394889/159556049-3f9d1689-bcba-4435-9826-c654abd99aee.mov

However, there are still problems if text overflows a line, as shown here:

https://user-images.githubusercontent.com/394889/160070603-d88650b7-1116-40c8-aa29-080444a829d6.mov

Related StackOverflow question