Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react-slingshot does not work properly with material-ui-pickers #571

Open
chenop opened this issue May 25, 2018 · 0 comments
Open

react-slingshot does not work properly with material-ui-pickers #571

chenop opened this issue May 25, 2018 · 0 comments

Comments

@chenop
Copy link

chenop commented May 25, 2018

Describe the bug
Its seems there is an issue with DatePicker component of material-ui-picker - does not reproduce with create-react-app

To Reproduce

Tech Version
material-ui-pickers ^1.0.0-rc.9
material-ui 1.0.0-rc.1
React 16.3.1
Browser Chrome
Platform Windows

Steps to reproduce

  1. install fresh installation of react-slingshot
  2. Add empty App.scss to styles directory
  3. Paste the following code to index.js
/* eslint-disable import/default */

import {render} from 'react-dom';
import configureStore, {history} from './store/configureStore';
import './styles/styles.scss'; // Yep, that's right. You can import SASS/CSS files too! Webpack will run the associated loader and plug this into the page.
import React, {Component} from "react";
import {DatePicker, MuiPickersUtilsProvider} from "material-ui-pickers";
import MomentUtils from 'material-ui-pickers/utils/moment-utils';
import CSSModules from "react-css-modules";
import styles from "./styles/App.scss";

require('./favicon.ico'); // Tell webpack to load favicon.ico
const store = configureStore();

class HOCAppContainer extends Component {
  render() {
    return (
      <MuiPickersUtilsProvider utils={MomentUtils}>
        HOC
        <DatePicker />
      </MuiPickersUtilsProvider>
    );
  }
}

const AppContainer = CSSModules(HOCAppContainer, styles);

render(
  <AppContainer />,
  document.getElementById('app')
);

if (module.hot) {
  module.hot.accept('./components/Root', () => {
    const NewRoot = require('./components/Root').default;
    render(
      <AppContainer>
        <NewRoot store={store} history={history} />
      </AppContainer>,
      document.getElementById('app')
    );
  });
}
  1. run:

npm start

  1. open localhost --> Open DatePicker --> click the one of the dates --> it "jump" back to the initial date

Expected behavior
The selection should stay on the selected day
Note: it reproduce only with react-slingshot

Actual behavior
The selection "jump" back to the initial selection

Screenshots

Desktop (please complete the following information):

  • OS: Windows
  • Browser Chrome
  • Version 67

Additional context
Could not upload react-slingshot to live example but created the repository with everything above
https://github.com/chenop/react-slingshot-material-ui-picker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant