Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

117
Vistas
Mouse stuck on Input?

I have no idea how to ask this question, but here's problem:

enter image description here

I have this kind of search bar ^ and when you double click on it it shrinks and input is disappearing (display: none). But when it disappears
enter image description here

And I-beam cursor shows. So I can't click or double click on it anymore (for some reason) I tried input.blur(); but because it's not focused it didn't work. I have no clue what to google to fixed. I tried some but there weren't any related answers.

HTML:

<div class="search-field">
    <input placeholder="Search" type="text">
    
    <img src="search.svg" title="Double Click to toggle">
    <img src="grip-lines.svg" alt="||" id="drag">
</div>

I use keyframes so I will how CSS too: (Edit: I will put more about css)

.search-field {
     position: absolute;
     width: 385px;
     width: 20%;
    background-color: #FFFFFF;
    top: 15px;
    left: 8%;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    padding: 5px;
    border-radius: 10px;
    border: 1px black solid;
  }
  input {
        height: 80%;
        width: 300px;
        outline: none;
        transition: .3s;
        border-radius: 10px;
        border: 1px black solid;
        padding: 3px 5px;
        background-color: #E4E9F7;
   }

  @keyframes openSearch {
    0% {
        width: 77px;
    }
    100% {
        width: 385px;
    }
  }
  @keyframes closeSearch {
    0% {
        width: 385px;
    }
    100% {
        width: 77px;
    }
  }

  .openedSearch {
      animation: openSearch 0.5s both;
  }
  .closedSearch {
      animation: closeSearch 0.5s both;
  }

JS:

    let searchState = true
    let toggleSearchState = () => {
    searchState = !searchState
    if (searchState == true) {
        searchField.className = 'search-field openedSearch'
        input.style.display = 'block'
       } else {
        searchField.className = 'search-field closedSearch'
        input.style.display = 'none'
      }
   }

searchBtn.addEventListener('dblclick', toggleSearchState)
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Since everything seems to be working fine on this fiddle. The only thing left (that I couldn't test) is the SVG images and any code you attached to them.

As the id of the pipe image is drag, I am assuming you have attached a drag event on it. Also, if the size of the image is not set you may be overlapping, covering the entire search-field when the width is set too 77px.

An easy solution would be to set the height and width of the img tag with the draggable event, so you can be sure it is not overlapping.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda