React-dates: SingleDatePicker auto closes on hover on today when withPortal={true}

Created on 28 Jan 2019  ·  6Comments  ·  Source: airbnb/react-dates

react-dates version
[email protected]

Describe the bug
SingleDatePicker auto closes on hover on today when withPortal={true}
onDateChange doesn't get called

Source code (including props configuration)
Steps to reproduce the behavior:

import React from 'react';
import { SingleDatePicker } from 'react-dates'
import 'react-dates/lib/css/_datepicker.css';

class Test extends React.Component {
  constructor() {
    super();

    this.state = {
      date: null,
      focused: false
    };
  }
  render() {
    console.log(this.state)
    return (
       <SingleDatePicker
        id="date_input"
        withPortal
        autoFocus
        numberOfMonths={1}        
        date={this.state.date} 
        onDateChange={date => { 
            console.log('date changes')
            return this.setState({ date })
         }}
        focused={this.state.focused}
        onFocusChange={({ focused }) => {
            console.log('onFocusChange changes')
            return this.setState({ focused })
         }} />
    )

  }
}

export default Test;

Is the issue reproducible in Storybook?
yes
http://airbnb.io/react-dates/?selectedKind=SDP%20-%20Calendar%20Props&selectedStory=horizontal%20with%20portal&full=0&addons=1&stories=1&panelRight=0&addonPanel=storybook%2Factions%2Factions-panel

Additional context
https://stackblitz.com/edit/react-5z8pun?file=Hello.js

bug pull request wanted

All 6 comments

Can I work on this issue?

@danedavid of course! Anything with the “pull request wanted” label is particularly up for grabs at any time :-)

@ljharb Looks like this issue has been fixed, maybe unknowingly, in https://github.com/airbnb/react-dates/pull/1533. The issue no longer persists.

Whoops, thanks for catching that!

Fixed in #1533.

With in modal SingleDatePicker auto closes on hover on today when withPortal={true}

@ghost could you provide some representation. Just checked storybook and it's ok

Was this page helpful?
0 / 5 - 0 ratings