React-datepicker: isClearable doesn't work in Firefox (Clear Icon not clickable)

Created on 25 May 2018  路  4Comments  路  Source: Hacker0x01/react-datepicker

Expected behavior

Clicking the X Icon should clear the input.
(Which works in Chrome & IE (and maybe more, but I just tested those)).

Actual behavior

The X Icon is not clickable, so nothing happens if you try to click it.

Steps to reprodcue

Open https://reactdatepicker.com/#example-25 with Firefox.
(Tested in Firefox Dev Edition 61.0b7 & Firefox 60.0.1)

Most helpful comment

Here's my solution:

.react-datepicker__close-icon {
  top: 25%;
  right: 7px;
  width: 16px;
  height: 16px !important;
  position: absolute;
}
.react-datepicker__close-icon::after {
  right: 0 !important;
  top: 0;
  margin: 0;
}

All 4 comments

This seems to be a styling issue. The icon is rendered with an ::after selector, but the parent in firefox (the button) has no width or height so it is not clickable. I fixed it by updating two styles with:

.react-datepicker__close-icon {
  top: 25%;
  right: 7px;
  width: 16px;
  height: 16px;
}
.react-datepicker__close-icon::after {
  right: 0
}

I have the same issue.

@pixelshaded You're right, this is indeed a styling issue. I tried using your style fix but it doesn't work correctly for me.
I'm going to try to fix it myseft later.

Here's my solution:

.react-datepicker__close-icon {
  top: 25%;
  right: 7px;
  width: 16px;
  height: 16px !important;
  position: absolute;
}
.react-datepicker__close-icon::after {
  right: 0 !important;
  top: 0;
  margin: 0;
}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

tamitutor picture tamitutor  路  3Comments

flaurida picture flaurida  路  3Comments

kkras3 picture kkras3  路  3Comments

evolve2k picture evolve2k  路  3Comments

ahribori picture ahribori  路  3Comments