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.

[MaterialDatePicker] Selecting year causes displayed month to jump around

See original GitHub issue

Description: With November 2019 shown, when I click the down arrow next to the year, then select a different year, like 2020, the displayed month goes to August 2020, August 2021, December 2021, February 2021, August 2020 then April 2020

Expected behavior: It shows a month in 2020

Source code:

TextInputEditText fromDateLayout = view.findViewById(R.id.from_date);
        fromDateLayout.setOnFocusChangeListener(new View.OnFocusChangeListener() {
            @Override
            public void onFocusChange(View v, boolean hasFocus) {
                if (hasFocus) {
                    MaterialDatePicker.Builder<Long> builder = MaterialDatePicker.Builder.datePicker();
                    builder.setTitleText("Date");
                    MaterialDatePicker<Long> picker = builder.build();

                    picker.show(getFragmentManager(), picker.toString());
                }
            }
        });

Android API version: 29

Material Library version: 1.2.0-alpha01

Device: Android Emulator

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
hunterstichcommented, Nov 12, 2019

Hey, any chance you’d be able to provide a small sample that reproduces this issue? Looking into this in our catalog, I’m not able reproduce what you’ve described (or I don’t fully understand the issue you’re running in). It looks like selecting a a different year in the single date picker will smoothly scroll from Nov. 2019 to Nov. 2020.

0reactions
paulfthomascommented, Feb 24, 2022

Couldn’t reproduce using the sample app provided by @thirstycoda and updating the Material lib to version 1.5.0. Please reopen if you’re still having issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular Material Datepicker - Translate Month Label (inside of ...
Everything works fine exept of the month label. ... How can I translate label inside of the top left button (where you pick...
Read more >
More Functionalities of Material Design Date Picker in Android
Functionality 4: Open the material date picker dialog at the specific month. For example, open the material date picker dialog in August month....
Read more >
How can I jump to a given year on the Google Calendar ...
there's no way to do this in the Android app, but you can ask Google Assistant to list events from a given month...
Read more >
Implementing a month picker with Angular Material
The calendar widget of the Angular Material date picker has three ... starts with selecting the month and allows you to choose the...
Read more >
Designing The Perfect Date And Time Picker
If so, how do we design it for days, months and years? ... There is too much jumping around two date pickers when...
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