community
community copied to clipboard
Fix TextInput cursor using padding_bottom instead of top
Reproduction:
from kivy.app import App
from kivy.lang.builder import Builder
KV = '''
TextInput:
padding: [10, 10, 10, 30]
'''
class TestApp(App):
def build(self):
return Builder.load_string(KV)
TestApp().run()
As you can see, the cursor and text position don't match. The root cause is that for cursor visual pos, textinput is calculating max_y as self.top - self.padding_bottom
instead of self.top - self.padding_top
(not real attributes, just pseudocode to make the point more clear).
Maintainer merge checklist
- [ ] Title is descriptive/clear for inclusion in release notes.
- [ ] Applied a
Component: xxx
label. - [ ] Applied the
api-deprecation
orapi-break
label. - [ ] Applied the
release-highlight
label to be highlighted in release notes. - [ ] Added to the milestone version it was merged into.
- [ ] Unittests are included in PR.
- [ ] Properly documented, including
versionadded
,versionchanged
as needed.