Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

118
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda