-1

For some reasons when I enter value in the search box and press the search icon, it does not hot enter . It happens only in FF. In chrome, if you press search icon, it works.

<div class="col-lg-12">
  <input id="query" name="query" type="search" class="form-control input-lg" value="">
  <button type="submit" class="submit"><i class="fa fa-search"></i></button>
</div>

Styles:

button.submit {
  border: 0px;
  box-sizing: initial;
  padding: 0px;
  margin: 0px;
}
.fa-search {
  position: absolute;
  top: 8px;
  right: 22px;
}

Any idea how to fix this? I mean is not the button supposed to be clickable when the icon search is pressed?

Hello Universe
  • 3,248
  • 7
  • 50
  • 86
  • 1
    Please add some code so that we can take a good look – Vinc199789 May 20 '15 at 07:32
  • 2
    @Hello Universe in Firefox search `button` is going behind `input` box so you have to provide the `position` to `button` tag & then provide `z-index` also. Or If you will not get the solution using `css` then try with `event.stopPropagation` on `click` of `submit` button. – Amit May 20 '15 at 07:34
  • anything related to this question http://stackoverflow.com/questions/18741019/onclick-event-fails-on-firefox – Suresh Ponnukalai May 20 '15 at 07:38

1 Answers1

1

Firstly Do not use the <i> tag for icons it's use is for wrapping around text that has a different meaning from the text & is required to be in italic's. Use a <div> instead

The main issue here is your CSS you have markup that is not treated well cross browser.

You have your .fa-search icon set as position:absolute; but its wrapper has no definitions on positioning or height etc; so it wont wrap its child you should give position:absolute; to the button as the button is what your pressing not the icon.


Remove the commented out styles from your class.

.bor-header .bor-header-search .fa-search {
  /* top: 8px; */
  /* right: 22px; */
  color: #5D6161;
  font-size: 28px;
  /* position: absolute; */
}
.bor-header .bor-header-search button.submit {
  background-color: #FFF;
  border: 0px none;
  box-sizing: initial;
  padding: 0px;
  margin: 0px;
  top: 2px;
  color: #5D6161;
  font-size: 28px;
  position: absolute;
  width: 25px;
  right: 25px;
  height: 25px;
}