question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

react-dates version react-dates@18.4.1

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

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
ghostcommented, Mar 5, 2020

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

1reaction
ljharbcommented, Feb 10, 2019

Whoops, thanks for catching that!

Fixed in #1533.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SingleDatePicker auto closes on hover on today ... - GitHub
Steps to reproduce the behavior: import React from 'react'; import { SingleDatePicker } from 'react-dates' import 'react-dates/lib/css/_ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found