To reproduce the issue, use 2 TextFields in need of keyboard awareness and tap the lower one. The scroll here will be correct, but tap the upper TextField while the keyboard is still showing and the bottom padding will be too little resulting in a (partially) hidden TextField. This issue seems to be caused by focusedTextInputBottom in the ViewModifier which is calculated based on the already scrolled View.
If I find the time I will look into this further myself. My current solution is taking the bottomPadding at the time of the calculation into account (in the ViewModifier):
var focusedTextInputBottom = UIResponder.currentFirstResponder?.globalFrame?.maxY ?? 0
focusedTextInputBottom` += self.bottomPadding
It seems to fix the problem, but I'm not sure about possible side effects and if this calculation is always right.
To reproduce the issue, use 2 TextFields in need of keyboard awareness and tap the lower one. The scroll here will be correct, but tap the upper TextField while the keyboard is still showing and the bottom padding will be too little resulting in a (partially) hidden TextField. This issue seems to be caused by
focusedTextInputBottomin theViewModifierwhich is calculated based on the already scrolled View.If I find the time I will look into this further myself. My current solution is taking the bottomPadding at the time of the calculation into account (in the
ViewModifier):It seems to fix the problem, but I'm not sure about possible side effects and if this calculation is always right.