object.placeholder bug!

Hi,

When i create a native.newTextField() and change the font and create a placeholder all shows ok with correct font in Android and IOS.

if i put .isSecured=true after i change the the font, it will work fine on IOS, on Android it will not show the correct font (on simulator it will show the correct font).

if i change the font after i put .isSecured=true then it will show the correct font on IOS and Android.

.isSecured should not break the font selection.

code working:

defaultField = native.newTextField(width, height, width\_text, height ) defaultField.placeholder=placeholder defaultField.isSecure=isSecure defaultField.font=native.newFont( font, fontSize ) defaultField:resizeHeightToFitFont()

code not working:

defaultField = native.newTextField(width, height, width\_text, height ) defaultField.placeholder=placeholder defaultField.font=native.newFont( font, fontSize ) defaultField.isSecure=isSecure -- break the font selected in previews line (only on android) defaultField:resizeHeightToFitFont()

Hi @carloscosta.

This certainly sounds like a bug, but it also seems like one easily avoided, unless I’m missing the use case. .isSecured is used to make the field show obscured text for password entry, I don’t know why you would switch the field type after the fact. So working around this bug is pretty straight forward.

I invite you to still submit a bug report but given the work around is straight forward, it will likely be a low priority item to fix.

Please create a sample project that demonstrates the problem with a main.lua, config.lua and build.settings and any assets needed in a .zip file and use the Report a bug link at the top of the page.

Rob

yes Rob, it’s easy to avoid, but it’s still a bug and you need to know it exists to avoid it.

Hi @carloscosta.

This certainly sounds like a bug, but it also seems like one easily avoided, unless I’m missing the use case. .isSecured is used to make the field show obscured text for password entry, I don’t know why you would switch the field type after the fact. So working around this bug is pretty straight forward.

I invite you to still submit a bug report but given the work around is straight forward, it will likely be a low priority item to fix.

Please create a sample project that demonstrates the problem with a main.lua, config.lua and build.settings and any assets needed in a .zip file and use the Report a bug link at the top of the page.

Rob

yes Rob, it’s easy to avoid, but it’s still a bug and you need to know it exists to avoid it.