Skip to content

defaultValue becomes a placeholder #3

@murtraja

Description

@murtraja

Issue:
Having a defaultValue prop passed in, makes it a placeholder (color greyed out). As soon as focus is granted to the field, this defaultValue which was passed, disappears and the field is cleared.
<TextField defaultValue={'this will become a placeholder :('}/>

Workaround:
instead of using defaultValue prop, use value prop. Now, whenever user clicks on the field and focus is granted, the defaultValue persists (and even the color is not greyed out)
<TextField value={'this will NOT become a placeholder, but a default value :)'}/>

"react-native-materialui-textfield": "^0.13.2",
"react": "^16.6.0",
"react-native": "0.57.3",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions