I'm using a multiline TextField on kivy and everything works fine until type multiple lines and I press anywhere on the UI. In the python code part, I'm not touching anything that has to do with text field so I don't think there's a problem from there. If the kv file bellow isn't enough I'll be more than happy to provide more information.

Thanks!

Here is my main.kv code:

<HomeScreen>:    
    name: "home"

    GridLayout:
        name: "main_grid"
        id: maingrid
        cols: 1

        MDToolbar:
            title: app.title
            md_bg_color: app.theme_cls.primary_color
            background_palette: "Primary"
            elevation: 10
            right_action_items: [['play', app.execute]]




        MDLabel:
            text: "Code:"
            size_hint: None, pt(.1)


        MDSeparator:

        MDTextFieldRect:
            id: code_field
            multiline: True
            pos_hint: {"center_x": .5}
            hint_text: "Enter your code here!"
            background_color: (0,0,0,0)

        MDLabel:
            text: "Result:"
            size_hint: None, pt(.1)

        MDSeparator:

        MDTextFieldRect:
            id: result_field
            multiline: True
            readonly: True
            pos_hint: {"center_x": .5}
            background_color: (0,0,0,0)
            color: "accent"


The full log in case is needed:

 Traceback (most recent call last):
   File "main.py", line 166, in <module>
     RextesterApp().run()
   File "/home/alexandrumarcel/.local/lib/python3.7/site-packages/kivy/app.py", line 826, in run
     runTouchApp()
   File "/home/alexandrumarcel/.local/lib/python3.7/site-packages/kivy/base.py", line 502, in runTouchApp
     EventLoop.window.mainloop()
   File "/home/alexandrumarcel/.local/lib/python3.7/site-packages/kivy/core/window/window_pygame.py", line 403, in mainloop
     self._mainloop()
   File "/home/alexandrumarcel/.local/lib/python3.7/site-packages/kivy/core/window/window_pygame.py", line 289, in _mainloop
     EventLoop.idle()
   File "/home/alexandrumarcel/.local/lib/python3.7/site-packages/kivy/base.py", line 340, in idle
     self.dispatch_input()
   File "/home/alexandrumarcel/.local/lib/python3.7/site-packages/kivy/base.py", line 325, in dispatch_input
     post_dispatch_input(*pop(0))
   File "/home/alexandrumarcel/.local/lib/python3.7/site-packages/kivy/base.py", line 231, in post_dispatch_input
     listener.dispatch('on_motion', etype, me)
   File "kivy/_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch
   File "/home/alexandrumarcel/.local/lib/python3.7/site-packages/kivy/core/window/__init__.py", line 1360, in on_motion
     self.dispatch('on_touch_down', me)
   File "kivy/_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch
   File "/home/alexandrumarcel/.local/lib/python3.7/site-packages/kivy/core/window/__init__.py", line 1376, in on_touch_down
     if w.dispatch('on_touch_down', touch):
   File "kivy/_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch
   File "/home/alexandrumarcel/.local/lib/python3.7/site-packages/kivy/uix/screenmanager.py", line 1191, in on_touch_down
     return super(ScreenManager, self).on_touch_down(touch)
   File "/home/alexandrumarcel/.local/lib/python3.7/site-packages/kivy/uix/widget.py", line 460, in on_touch_down
     if child.dispatch('on_touch_down', touch):
   File "kivy/_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch
   File "/home/alexandrumarcel/.local/lib/python3.7/site-packages/kivy/uix/relativelayout.py", line 288, in on_touch_down
     ret = super(RelativeLayout, self).on_touch_down(touch)
   File "/home/alexandrumarcel/.local/lib/python3.7/site-packages/kivy/uix/widget.py", line 460, in on_touch_down
     if child.dispatch('on_touch_down', touch):
   File "kivy/_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch
   File "/home/alexandrumarcel/.local/lib/python3.7/site-packages/kivy/uix/widget.py", line 460, in on_touch_down
     if child.dispatch('on_touch_down', touch):
   File "kivy/_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch
   File "/home/alexandrumarcel/.local/lib/python3.7/site-packages/kivy/uix/textinput.py", line 1340, in on_touch_down
     if super(TextInput, self).on_touch_down(touch):
   File "/home/alexandrumarcel/.local/lib/python3.7/site-packages/kivy/uix/behaviors/focus.py", line 441, in on_touch_down
     self.focus = True
   File "kivy/properties.pyx", line 483, in kivy.properties.Property.__set__
   File "kivy/properties.pyx", line 524, in kivy.properties.Property.set
   File "kivy/properties.pyx", line 579, in kivy.properties.Property.dispatch
   File "kivy/_event.pyx", line 1214, in kivy._event.EventObservers.dispatch
   File "kivy/_event.pyx", line 1120, in kivy._event.EventObservers._dispatch
   File "/home/alexandrumarcel/.local/lib/python3.7/site-packages/kivy/uix/behaviors/focus.py", line 384, in _on_focus
     self._bind_keyboard()
   File "/home/alexandrumarcel/.local/lib/python3.7/site-packages/kivy/uix/behaviors/focus.py", line 399, in _bind_keyboard
     self._ensure_keyboard()
   File "/home/alexandrumarcel/.local/lib/python3.7/site-packages/kivy/uix/behaviors/focus.py", line 393, in _ensure_keyboard
     self._keyboard_released, self, input_type=self.input_type)
   File "/home/alexandrumarcel/.local/lib/python3.7/site-packages/kivy/core/window/window_pygame.py", line 445, in request_keyboard
     callback, target, input_type)
   File "/home/alexandrumarcel/.local/lib/python3.7/site-packages/kivy/core/window/__init__.py", line 1902, in request_keyboard
     self.release_keyboard(target)
   File "/home/alexandrumarcel/.local/lib/python3.7/site-packages/kivy/core/window/window_pygame.py", line 451, in release_keyboard
     super(WindowPygame, self).release_keyboard(*largs)
   File "/home/alexandrumarcel/.local/lib/python3.7/site-packages/kivy/core/window/__init__.py", line 1980, in release_keyboard
     callback()
   File "/home/alexandrumarcel/.local/lib/python3.7/site-packages/kivy/uix/behaviors/focus.py", line 433, in _keyboard_released
     self.focus = False
   File "kivy/properties.pyx", line 483, in kivy.properties.Property.__set__
   File "kivy/properties.pyx", line 524, in kivy.properties.Property.set
   File "kivy/properties.pyx", line 579, in kivy.properties.Property.dispatch
   File "kivy/_event.pyx", line 1214, in kivy._event.EventObservers.dispatch
   File "kivy/_event.pyx", line 1096, in kivy._event.EventObservers._dispatch
   File "/home/alexandrumarcel/.local/lib/python3.7/site-packages/kivy/lang/builder.py", line 64, in custom_callback
     exec(__kvlang__.co_value, idmap)
   File "<string>", line 89, in <module>
   File "/usr/local/lib/python3.7/dist-packages/kivymd/textfields.py", line 330, in anim_rect
     instance_line = root_canvas.children[2]
 AttributeError: 'kivy.graphics.context_instructions.BindTexture' object has no attribute 'children'

1 Answers

0
Nitan Alexandru Marcel On

I made an issue on GitHub at the time I posted this question and the problem has been fixed by the developer of kivymd