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] Remove the hasLeadingZeros property from FieldSection #10994

Merged
merged 4 commits into from
Nov 10, 2023

Conversation

flaviendelangle
Copy link
Member

@flaviendelangle flaviendelangle commented Nov 10, 2023

Closes #10993

Changelog

Breaking changes

  • The property hasLeadingZeros has been removed from the sections in favor of the more precise hasLeadingZerosInFormat and hasLeadingZerosInInput properties.
    To keep the same behavior, you can replace it by hasLeadingZerosInFormat:

     const fieldRef = React.useRef<FieldRef<FieldSection>>(null);
    
     React.useEffect(() => {
         const firstSection = fieldRef.current!.getSections()[0]
    -    console.log(firstSection.hasLeadingZeros)
    +    console.log(firstSection.hasLeadingZerosInFormat)
     }, [])
    
     return (
       <DateField unstableFieldRef={fieldRef} />
     );

@flaviendelangle flaviendelangle self-assigned this Nov 10, 2023
@flaviendelangle flaviendelangle added breaking change component: pickers This is the name of the generic UI component, not the React module! v7.x labels Nov 10, 2023
@flaviendelangle flaviendelangle changed the title [pickers] Remove the hasLeadingZeros property from FieldSection [pickers] Remove the hasLeadingZeros property from FieldSection Nov 10, 2023
@mui-bot
Copy link

mui-bot commented Nov 10, 2023

@flaviendelangle flaviendelangle marked this pull request as ready for review November 10, 2023 11:11
@flaviendelangle flaviendelangle merged commit 490e5e2 into mui:next Nov 10, 2023
18 checks passed
@flaviendelangle flaviendelangle deleted the hasLeadingZeros-bc branch November 10, 2023 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change component: pickers This is the name of the generic UI component, not the React module! v7.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[pickers] v7: Remove the hasLeadingZeros property from FieldSection
3 participants