kivy / kivy-ios

Toolchain for compiling Python / Kivy / other libraries for iOS
https://kivy.org/docs/guide/packaging-ios.html
MIT License
758 stars 238 forks source link

The toggling of the 'readonly' attribute (True/False) for the MDTextField is not functioning as expected in the xcode build #811

Closed mrtruongleo closed 1 year ago

mrtruongleo commented 1 year ago

Versions

Describe the bug I'm using KivyMD to create an MDTextField with the 'readonly' attribute toggled by a button. Everything works fine when testing on my Mac (using python main.py on VsCode), but when I build it for Xcode and run it on my iPhone or my Mac M1, the text field becomes uneditable if I disable it and then re-enable it. Anyone know how to fix this? Thank you! To Reproduce

from kivymd.app import MDApp
from kivymd.uix.boxlayout import MDBoxLayout
from kivy.lang import Builder
Builder.load_string('''
<Test>:
    orientation: 'vertical'
    adaptive_height: True
    spacing: dp(20)
    pos_hint: {'center_x':.5, 'center_y': .5}
    MDTextField:
        id: username
        hint_text: 'Set username'
        mode: "round"
        icon_left: 'account'
        write_tab: False
        size_hint_x: 0.7
        pos_hint: {'center_x':.5, 'center_y': .5}
    MDBoxLayout:
        orientation: 'horizontal'
        adaptive_height: True
        size_hint_x: 0.5
        spacing: dp(20)
        pos_hint: {'center_x':.5, 'center_y': .5}
        MDRaisedButton:
            text: 'Enable Edit'            
            on_release: 
                username.readonly = False
                print('enabled')
        MDRaisedButton:
            text: 'Disable Edit'
            on_release: 
                username.readonly = True
                print('disabled')

''')
class Test(MDBoxLayout):
    pass
class Example(MDApp):
    def build(self):
        return Test()

Example().run()

5DA81514-159D-4BE9-A868-964E95FF9D49

github-actions[bot] commented 1 year ago

👋 We use the issue tracker exclusively for bug reports and feature requests. However, this issue appears to be a support request. Please use our support channels to get help with the project.

If you're having trouble installing or using kivy-ios, maybe you could be interested to installation and requirements.

Let us know if this comment was made in error, and we'll be happy to reopen the issue.