Commit ff5e4b4
fix: prevent month view jump when selecting from second calendar in range mode
When using monthsShown={2} with selectsRange={true}, selecting a date
from the second calendar no longer causes the view to jump back to the
first month.
The previous fix for #5939 unconditionally reset monthSelectedIn to 0
on every update when selectsRange was true. This fix changes it to only
reset when the calendar opens (transitions from closed to open), which
preserves the #5939 fix while allowing normal interaction with the
second calendar.
Fixes #5275
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent ff23ce8 commit ff5e4b4
2 files changed
+46
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
360 | | - | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
361 | 370 | | |
362 | 371 | | |
363 | 372 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2922 | 2922 | | |
2923 | 2923 | | |
2924 | 2924 | | |
2925 | | - | |
| 2925 | + | |
2926 | 2926 | | |
2927 | | - | |
| 2927 | + | |
2928 | 2928 | | |
2929 | 2929 | | |
2930 | 2930 | | |
2931 | 2931 | | |
2932 | 2932 | | |
2933 | | - | |
| 2933 | + | |
2934 | 2934 | | |
2935 | 2935 | | |
2936 | 2936 | | |
| 2937 | + | |
| 2938 | + | |
2937 | 2939 | | |
2938 | 2940 | | |
2939 | 2941 | | |
2940 | 2942 | | |
2941 | 2943 | | |
2942 | 2944 | | |
2943 | 2945 | | |
2944 | | - | |
| 2946 | + | |
| 2947 | + | |
| 2948 | + | |
| 2949 | + | |
| 2950 | + | |
| 2951 | + | |
| 2952 | + | |
| 2953 | + | |
| 2954 | + | |
| 2955 | + | |
| 2956 | + | |
| 2957 | + | |
| 2958 | + | |
2945 | 2959 | | |
2946 | 2960 | | |
2947 | 2961 | | |
2948 | 2962 | | |
2949 | 2963 | | |
2950 | | - | |
2951 | 2964 | | |
| 2965 | + | |
| 2966 | + | |
2952 | 2967 | | |
2953 | 2968 | | |
| 2969 | + | |
2954 | 2970 | | |
2955 | | - | |
| 2971 | + | |
| 2972 | + | |
| 2973 | + | |
| 2974 | + | |
| 2975 | + | |
| 2976 | + | |
| 2977 | + | |
| 2978 | + | |
| 2979 | + | |
| 2980 | + | |
| 2981 | + | |
| 2982 | + | |
| 2983 | + | |
| 2984 | + | |
| 2985 | + | |
2956 | 2986 | | |
2957 | 2987 | | |
2958 | 2988 | | |
| |||
0 commit comments