React-day-picker: DayPickerInput: Click handling broken in IE

Created on 15 Mar 2018  路  6Comments  路  Source: gpbl/react-day-picker

It seems the 7.10 release broke DayPickerInput date and month selection for IE. The problem seems to come from the changes introduced in https://github.com/gpbl/react-day-picker/pull/598. This is due to IE(9-11) emitting blur events with relatedTarget being null, which causes the overlay to always hide on blur regardless if the click happens inside overlay (--> date and month selection won't work). This can be reproduced on the example page at http://react-day-picker.js.org/examples/input.

See also https://github.com/facebook/react/issues/3751

From my understanding, focusout handler wouldn't be much better for compatibility with Firefox support starting from v52 (https://developer.mozilla.org/en-US/docs/Web/Events/focusout). Not sure if there is any clean workaround apart from rolling back or using a global event handler.

help wanted

Most helpful comment

@gpbl any updates?

All 6 comments

Ugh this is hitting again :/ Maybe a solution is hinted here: https://github.com/facebook/react/issues/11405#issuecomment-340749008

If someone wants to jump in and try to fix this... I can't test on IE right now.

This is fixed in v7.1.8. Please report back if you find again a similar issue, thanks!

It's breaking in Firefox,

https://codesandbox.io/s/x7n2qz1kq4
Date Picker doesn't close when you change a month but don't select a date.

@akki199421 if showOverlay is set to true it works this way in any browser.

@gpbl sorry, forgot to remove that, updated the code. If you change the month or year, the picker won't close.

https://codesandbox.io/s/563n6r9o4

@gpbl any updates?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

laidinidis picture laidinidis  路  6Comments

brpontes picture brpontes  路  6Comments

trevordmiller picture trevordmiller  路  4Comments

magnusohlin picture magnusohlin  路  4Comments

samsch picture samsch  路  6Comments