Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Comercial
    • Calculadora

0

73
Vistas
How to make sure that when entering the input, the "+" sign does not give out like this "% 2b"?

Here's how you can get rid of this so that the "+" sign is always displayed, and not incomprehensible characters? I don’t know how you can write the code for it to work normally

   const [isSearchOpen, setSearchOpen] = useState(false),
       formRef = useRef(null);
   useClickOutside(formRef, () => setSearchOpen(false));
   const [inputText, setInputText] = useState("");
   const handleSubmit = e => {
       if (inputText.length >= 150) {
           alert('Maximum length 150 characters ')
           e.preventDefault();
       }
   };


   return (
       <form
           ref={formRef}
           className={cn("search-form", {
               "search-form--focus": isSearchOpen,
           })}
           onClick={() => setSearchOpen(true)}
           onKeyPress={() => setSearchOpen(true)}
           action="/search"
           // eslint-disable-next-line
           role="searchbox"
           onSubmit={handleSubmit}
       >
           
           <input
               value={inputText}
               onChange={e => setInputText(e.target.value)}
               className="search-form__input"
               name="filter"
               type="text"
           
           />
         
           
           <button
               className="search-form__button"
               type="submit"
               aria-label="Header search button"
           />
       </form>
   );
};
7 months ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos