FixMultiplePanelShift.tsx 942 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import React, { useState } from 'react';
  2. import DatePicker from '../../index';
  3. /**
  4. * test with cypress
  5. *
  6. * fix issue 1422
  7. * @see https://github.com/DouyinFE/semi-design/issues/1422
  8. */
  9. export default function App() {
  10. const [date, setDate] = useState();
  11. const handleChange = newDate => {
  12. setDate(newDate);
  13. };
  14. return (
  15. <div>
  16. <DatePicker
  17. type="date"
  18. multiple
  19. defaultPickerValue={'2019-07-01'}
  20. style={{ width: 260 }}
  21. onChange={console.log}
  22. />
  23. <DatePicker
  24. type="date"
  25. multiple
  26. defaultPickerValue={'2019-07-01'}
  27. placeholder="受控"
  28. style={{ width: 260 }}
  29. value={date}
  30. onChange={handleChange}
  31. />
  32. </div>
  33. );
  34. }
  35. App.storyName = '修复多选面板漂移问题';