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

[pickers] Fix toolbar on the new range pickers #6989

Merged
merged 14 commits into from
Dec 5, 2022

Conversation

flaviendelangle
Copy link
Member

@flaviendelangle flaviendelangle commented Nov 24, 2022

Fixes #6958 (comment)

We did not pass the props to switch between the start and the end date to the toolbar

Changelog

Breaking changes

  • The currentlySelectingRangeEnd / setCurrentlySelectingRangeEnd props on the Date Range Picker toolbar have been renamed to rangePosition / onRangePositionChange.

     const CustomToolbarComponent = props => (
       <div>
    -    <button onChange={() => props.setCurrentlySelectingRangeEnd('end')}>Edit end date</button>
    +    <button onClick={() => props.onRangePositionChange('end')}>Edit end date</button>
    -    <div>Is editing end date: {props.currentlySelectingRangeEnd === 'end'}</div>
    +    <div>Is editing end date: {props.rangePosition === 'end'}</div>
       </div>
     )
     <DateRangePicker
       components={{
         Toolbar: CustomToolbarComponent
       }}
     />

@flaviendelangle flaviendelangle self-assigned this Nov 24, 2022
@flaviendelangle flaviendelangle added bug 🐛 Something doesn't work component: pickers This is the name of the generic UI component, not the React module! labels Nov 24, 2022
@mui-bot
Copy link

mui-bot commented Nov 24, 2022

Messages
📖 Netlify deploy preview: https://deploy-preview-6989--material-ui-x.netlify.app/

These are the results for the performance tests:

Test case Unit Min Max Median Mean σ
Filter 100k rows ms 618.2 958.8 763 765.32 134.25
Sort 100k rows ms 593.5 1,102.2 816.6 846.66 161.993
Select 100k rows ms 214.7 300 227.5 247.84 33.932
Deselect 100k rows ms 136.2 271.9 208.3 209.24 43.649

Generated by 🚫 dangerJS against 77673d5

@flaviendelangle flaviendelangle marked this pull request as ready for review November 30, 2022 09:33
@flaviendelangle flaviendelangle merged commit f53506d into mui:next Dec 5, 2022
@flaviendelangle flaviendelangle deleted the range-picker-toolbar branch December 5, 2022 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: pickers This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants