Skip to content
This repository has been archived by the owner on Apr 19, 2021. It is now read-only.

placeholder text disappear when textfield is erased #162

Open
ghost opened this issue Jul 19, 2017 · 1 comment
Open

placeholder text disappear when textfield is erased #162

ghost opened this issue Jul 19, 2017 · 1 comment

Comments

@ghost
Copy link

ghost commented Jul 19, 2017

how make sure the placeholder is always there if the user clear the text field.

@RLRG
Copy link

RLRG commented Sep 26, 2017

Hi @pprevalon:

What you have to do is to set the property of the cell "placeholder" to the value you want to appear in each cell.

So, for example, instead of the following line of code (taken from the example app SwiftFormsApplication):

row.configuration.cell.appearance = ["textField.placeholder" : "e.g. gethooksapp.com" as AnyObject, "textField.textAlignment" : NSTextAlignment.right.rawValue as AnyObject]

You would need to code the following:

row.configuration.cell.appearance = ["textField.textAlignment" : NSTextAlignment.right.rawValue as AnyObject]
row.configuration.cell.placeholder = "e.g. gethooksapp.com"`

I will make a Pull Request now with the changes in the example app with this change ;)

I hope this helps !

Best regards,

RLRG

P.S.: I am new contributing to open-source projects so that I don't know how to close this issue, I suppose it is the admin of the repo the one responsible for doing it, isn't it?

RLRG added a commit to RLRG/SwiftForms that referenced this issue Sep 26, 2017
When the user entered some text in any of the cells and left the cell empty after that, the placeholder was not appearing any more. With these changes, the placeholder appears again when the text of the cell is empty.

Fixes the following issue: ortuman#162 placeholder text disappear when textfield is erased
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant