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

111
Views
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 answers
Answer question

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 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!