Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

59
Views
Quiero conservar el marcador de posición en el lado izquierdo mientras escribo cualquier tipo de texto en el campo TextInput en React Native

Aquí está mi código... por favor revise el código y guíeme.... lo que tengo que hacer para eso

 <Input containerStyle={tailwind('mt-4')} label="Item Price" labelStyle={{fontWeight: '800'}} theme="secondary" keyboardType={'numeric'} type="underline" placeholder="$" clear={true} onBlur={onBlur} value={price} onChangeText={text => setPrice(text)} errorMessage={ !/\d+((,\d+)+)?(.\d+)?(.\d+)?(,\d+)?/.test(price) && price ? 'Invalid Price' : null } /> )} name={'price'}
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Puedes hacer algo como

 import React, { useState } from "react"; import { Text, TextInput, View } from "react-native"; const App = () => { const [text, setText] = useState(""); return ( <View style={{ flexDirection: "row", borderWidth: 1, borderColor: "red" }}> {text.length > 0 && <Text style={{ color: "grey" }}>$</Text>} <TextInput style={{ color: "grey" }} placeholder="Type here to translate!" onChangeText={(newText) => setText(newText)} defaultValue={text} /> </View> ); }; export default App;
about 4 years ago · Juan Pablo Isaza Report

0

Si desea que el texto esté en la entrada todo el tiempo, debe ponerlo en el valor y obligarlo a estar allí. O tiene que usar otro elemento y colocarlo sobre la entrada.

 .ds { position: absolute; margin-left: .6em; font-size: .8em; line-height: 1.5em; } .ds + input { padding-left: 1em; }
 <label for="x" class="ds">$</label><input type="text" id="x">

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!