corona icon indicating copy to clipboard operation
corona copied to clipboard

[iOS]: Add property to include clear button in edit field

Open dethier1958 opened this issue 3 years ago • 1 comments

In iOS, the edit field can include a button to clear the edit field of text (setting the clearbuttonmode for the edit field). Please add a property that will add this to the native edit field for iOS. While I could do my own button outside the edit field, this would not include the expected behavior under iOS. It would be better to support the built in iOS clear button. Thanks.

dethier1958 avatar Mar 29 '22 01:03 dethier1958

I figured out a way to do it, if textfield is my native text field:

textfield:setNativeProperty('clearButtonMode', 1)

I would prefer to figure out what the name of the value is, instead of using 1, but I haven't found a name that worked. 1 is equivalent to the constant UITextFieldViewModeWhileEditing, but using that in a string as the value doesn't work.

It would be preferable to be able to do this with a property like:

textfield.clearButtonMode = 'whileEditing'

Perhaps this can be added in a future version?

dethier1958 avatar Mar 29 '22 05:03 dethier1958

This is added in the newest build

scottrules44 avatar Jun 03 '23 21:06 scottrules44