halilb / halilb/react-native-textinput-effects

Allow for a separate placeholder and label for the text input

Abierto
#12 2 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
JavaScript
Estrellas
3k
Forks
287
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

I wanted to suggest a feature for this component and get some feedback from the users of the component. I think traditionally one may create a text input component by having a separate label and a text input component and the text input component could have a placeholder which may instruct the user what needs to be inputted or some example of valid inputs. With this component, we are going away from an explicit label and specifying the label as part of the text input itself due to which it is not really possible to specify a placeholder for the text input as it would conflict with the label in the rendered component.

I was thinking if it would make sense to add functionality such that if both `placeholder` and `label` are specified, then if the text input box is empty, the `placeholder` is shown and if the text input box has some valid value, the `label` is shown. By doing this, we can have placeholder such as `Enter name of the product` as placeholder and `Product Name` as the label. The placeholder provides a clear instruction to the user what is needed and once the user enters the product name, the label `Product Name` is shown as expected. Just having `Product Name` as the placeholder when the text input box is empty may sometimes be confusing to a very layman user.

Additionally, if the `placeholder` is not specified, we fallback to the current behavior. So, it is not going to break any existing code as the `placeholder` and `label` can't be used together right now.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Comienza localizando el manejo existente de label y placeholder del componente y, a continuación, inspecciona cómo cambia el input renderizado entre los estados vacío y con contenido. El trabajo estará terminado cuando se admitan valores separados de placeholder y label con el comportamiento solicitado para los estados vacío y con contenido, manteniendo el fallback actual cuando no haya placeholder.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
javascript, react-native
Área
mobile
Tipo de issue
Nueva funcionalidad
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.