Repository: Hacker0x01/react-datepicker (ts)

Issue:
Time list height doesn't adjust when switching between months with different week counts
**Describe the bug**
react-datepicker__time-list height is not updated when navigating from 5 weeks month (June 2020) to 6 weeks month (May 2020)

**To Reproduce**

Go to the official web site with examples, pick any with date and time
Open a 5 week month (June 2020)
Navigate to a 6 week month (May 2020)

**Expected behavior**
react-datepicker__time-list height should adjust to calendar height changes

**Screenshots**

![Image](https://github.com/user-attachments/assets/a7e6f5d9-5a0f-41e4-8b64-2db2ee0959de)

**Desktop (please complete the following information):**

- OS: MacOS
- Browser: Chrome, Safari


Pull request:
🎨🔨 Re-adjust the height of TimePicker on Calendar resize due to number of days
Closes #5466

## Description
As mentioned in the ticket, the Time Picker height is not getting updated when we switch between months, so sometimes when we switch from 30 days month to 31 days month and vice a versa, we have some UI-issues.  I added a Resize-Observer and update the time picker height whenever calendar popup height changes and updated the test cases for it.

## Contribution checklist
- [x] I have followed the [contributing guidelines](https://github.com/Hacker0x01/react-datepicker/blob/main/CONTRIBUTING.md).
- [x] I have added sufficient test coverage for my changes.
- [x] I have formatted my code with Prettier and checked for linting issues with ESLint for code readability.


Patch:
diff --git a/docs-site/package.json b/docs-site/package.json
index 2d65adf5..8758f022 100644
--- a/docs-site/package.json
+++ b/docs-site/package.json
@@ -21,17 +21,17 @@
     "preview": "vite preview"
   },
   "devDependencies": {
-    "@eslint/js": "^9.23.0",
+    "@eslint/js": "^9.22.0",
     "@types/react": "^19.0.10",
     "@types/react-dom": "^19.0.4",
     "@vitejs/plugin-react": "^4.3.4",
-    "eslint": "^9.23.0",
+    "eslint": "^9.22.0",
     "eslint-plugin-react": "^7.37.4",
     "eslint-plugin-react-hooks": "^5.2.0",
     "eslint-plugin-react-refresh": "^0.4.19",
     "globals": "^16.0.0",
-    "sass": "^1.86.0",
-    "vite": "^6.2.3"
+    "sass": "^1.85.1",
+    "vite": "^6.2.1"
   },
   "packageManager": "yarn@4.6.0"
 }
diff --git a/docs-site/yarn.lock b/docs-site/yarn.lock
index 305d72d1..48c636eb 100644
--- a/docs-site/yarn.lock
+++ b/docs-site/yarn.lock
@@ -482,10 +482,10 @@ __metadata:
   languageName: node
   linkType: hard
 
-"@eslint/config-helpers@npm:^0.2.0":
-  version: 0.2.0
-  resolution: "@eslint/config-helpers@npm:0.2.0"
-  checksum: 10c0/743a64653e13177029108f57ab47460ded08e3412c86216a14b7e8ab2dc79c2b64be45bf55c5ef29f83692a707dc34cf1e9217e4b8b4b272a0d9b691fdaf6a2a
+"@eslint/config-helpers@npm:^0.1.0":
+  version: 0.1.0
+  resolution: "@eslint/config-helpers@npm:0.1.0"
+  checksum: 10c0/3562b5325f42740fc83b0b92b7d13a61b383f8db064915143eec36184f09a09fad73eca6c2955ab6c248b0d04fa03c140f9af2f2c4c06770781a6b79f300a01e
   languageName: node
   linkType: hard
 
@@ -498,9 +498,9 @@ __metadata:
   languageName: node
   linkType: hard
 
-"@eslint/eslintrc@npm:^3.3.1":
-  version: 3.3.1
-  resolution: "@eslint/eslintrc@npm:3.3.1"
+"@eslint/eslintrc@npm:^3.3.0":
+  version: 3.3.0
+  resolution: "@eslint/eslintrc@npm:3.3.0"
   dependencies:
     ajv: "npm:^6.12.4"
     debug: "npm:^4.3.2"
@@ -511,14 +511,14 @@ __metadata:
     js-yaml: "npm:^4.1.0"
     minimatch: "npm:^3.1.2"
     strip-json-comments: "npm:^3.1.1"
-  checksum: 10c0/b0e63f3bc5cce4555f791a4e487bf999173fcf27c65e1ab6e7d63634d8a43b33c3693e79f192cbff486d7df1be8ebb2bd2edc6e70ddd486cbfa84a359a3e3b41
+  checksum: 10c0/215de990231b31e2fe6458f225d8cea0f5c781d3ecb0b7920703501f8cd21b3101fc5ef2f0d4f9a38865d36647b983e0e8ce8bf12fd2bcdd227fc48a5b1a43be
   languageName: node
   linkType: hard
 
-"@eslint/js@npm:9.23.0, @eslint/js@npm:^9.23.0":
-  version: 9.23.0
-  resolution: "@eslint/js@npm:9.23.0"
-  checksum: 10c0/4e70869372b6325389e0ab51cac6d3062689807d1cef2c3434857571422ce11dde3c62777af85c382b9f94d937127598d605d2086787f08611351bf99faded81
+"@eslint/js@npm:9.22.0, @eslint/js@npm:^9.22.0":
+  version: 9.22.0
+  resolution: "@eslint/js@npm:9.22.0"
+  checksum: 10c0/5bcd009bb579dc6c6ed760703bdd741e08a48cd9decd677aa2cf67fe66236658cb09a00185a0369f3904e5cffba9e6e0f2ff4d9ba4fdf598fcd81d34c49213a5
   languageName: node
   linkType: hard
 
@@ -2178,17 +2178,17 @@ __metadata:
   languageName: node
   linkType: hard
 
-"eslint@npm:^9.23.0":
-  version: 9.23.0
-  resolution: "eslint@npm:9.23.0"
+"eslint@npm:^9.22.0":
+  version: 9.22.0
+  resolution: "eslint@npm:9.22.0"
   dependencies:
     "@eslint-community/eslint-utils": "npm:^4.2.0"
     "@eslint-community/regexpp": "npm:^4.12.1"
     "@eslint/config-array": "npm:^0.19.2"
-    "@eslint/config-helpers": "npm:^0.2.0"
+    "@eslint/config-helpers": "npm:^0.1.0"
     "@eslint/core": "npm:^0.12.0"
-    "@eslint/eslintrc": "npm:^3.3.1"
-    "@eslint/js": "npm:9.23.0"
+    "@eslint/eslintrc": "npm:^3.3.0"
+    "@eslint/js": "npm:9.22.0"
     "@eslint/plugin-kit": "npm:^0.2.7"
     "@humanfs/node": "npm:^0.16.6"
     "@humanwhocodes/module-importer": "npm:^1.0.1"
@@ -2224,7 +2224,7 @@ __metadata:
       optional: true
   bin:
     eslint: bin/eslint.js
-  checksum: 10c0/9616c308dfa8d09db8ae51019c87d5d05933742214531b077bd6ab618baab3bec7938256c14dcad4dc47f5ba93feb0bc5e089f68799f076374ddea21b6a9be45
+  checksum: 10c0/7b5ab6f2365971c16efe97349565f75d8343347562fb23f12734c6ab2cd5e35301373a0d51e194789ddcfdfca21db7b62ff481b03d524b8169896c305b65ff48
   languageName: node
   linkType: hard
 
@@ -4019,12 +4019,12 @@ __metadata:
   version: 0.0.0-use.local
   resolution: "react-datepicker-docs@workspace:."
   dependencies:
-    "@eslint/js": "npm:^9.23.0"
+    "@eslint/js": "npm:^9.22.0"
     "@types/react": "npm:^19.0.10"
     "@types/react-dom": "npm:^19.0.4"
     "@vitejs/plugin-react": "npm:^4.3.4"
     date-fns: "npm:^4.1.0"
-    eslint: "npm:^9.23.0"
+    eslint: "npm:^9.22.0"
     eslint-plugin-react: "npm:^7.37.4"
     eslint-plugin-react-hooks: "npm:^5.2.0"
     eslint-plugin-react-refresh: "npm:^0.4.19"
@@ -4036,9 +4036,9 @@ __metadata:
     react-datepicker: "portal:../"
     react-dom: "npm:^19.0.0"
     react-live: "npm:^4.1.8"
-    sass: "npm:^1.86.0"
+    sass: "npm:^1.85.1"
     slugify: "npm:^1.6.6"
-    vite: "npm:^6.2.3"
+    vite: "npm:^6.2.1"
   languageName: unknown
   linkType: soft
 
@@ -4313,9 +4313,9 @@ __metadata:
   languageName: node
   linkType: hard
 
-"sass@npm:^1.86.0":
-  version: 1.86.0
-  resolution: "sass@npm:1.86.0"
+"sass@npm:^1.85.1":
+  version: 1.85.1
+  resolution: "sass@npm:1.85.1"
   dependencies:
     "@parcel/watcher": "npm:^2.4.1"
     chokidar: "npm:^4.0.0"
@@ -4326,7 +4326,7 @@ __metadata:
       optional: true
   bin:
     sass: sass.js
-  checksum: 10c0/921caea1fd8a450d4a986e5570ce13c4ca7b2a57da390811add3d2087ad8f46f53b34652ddcb237d8bdaad49c560b8d6eee130c733c787d058bc5a71a914c139
+  checksum: 10c0/f843aa1df1dca2f0e9cb2fb247e4939fd514ae4c182cdd1900a0622c0d71b40dfb1c4225f78b78e165a318287ca137ec597695db3e496408bd16a921a2bc2b3f
   languageName: node
   linkType: hard
 
@@ -4933,9 +4933,9 @@ __metadata:
   languageName: node
   linkType: hard
 
-"vite@npm:^6.2.3":
-  version: 6.2.3
-  resolution: "vite@npm:6.2.3"
+"vite@npm:^6.2.1":
+  version: 6.2.1
+  resolution: "vite@npm:6.2.1"
   dependencies:
     esbuild: "npm:^0.25.0"
     fsevents: "npm:~2.3.3"
@@ -4981,7 +4981,7 @@ __metadata:
       optional: true
   bin:
     vite: bin/vite.js
-  checksum: 10c0/ba6ad7e83e5a63fb0b6f62d3a3963624b8784bdc1bfa2a83e16cf268fb58c76bd9f8e69f39ed34bf8711cdb8fd7702916f878781da53c232c34ef7a85e0600cf
+  checksum: 10c0/2c024376a840eae2ce9cfba98d62e9f1eae93caa8304875854dbc0740414aedcfbe157c2244567bd456cdb60a300312af02ae9b5c63c147d35cf4da3a0591312
   languageName: node
   linkType: hard
 
diff --git a/examples/hello-world/package.json b/examples/hello-world/package.json
index cd2b8f9c..ac4a3d82 100644
--- a/examples/hello-world/package.json
+++ b/examples/hello-world/package.json
@@ -3,9 +3,9 @@
   "version": "0.1.0",
   "private": true,
   "dependencies": {
-    "react": "^19.1.0",
-    "react-datepicker": "^8.2.1",
-    "react-dom": "^19.1.0",
+    "react": "^19.0.0",
+    "react-datepicker": "^8.2.0",
+    "react-dom": "^19.0.0",
     "react-scripts": "5.0.1"
   },
   "scripts": {
diff --git a/examples/hello-world/yarn.lock b/examples/hello-world/yarn.lock
index ce6b2620..f166a003 100644
--- a/examples/hello-world/yarn.lock
+++ b/examples/hello-world/yarn.lock
@@ -7130,9 +7130,9 @@ __metadata:
   version: 0.0.0-use.local
   resolution: "hello-world@workspace:."
   dependencies:
-    react: "npm:^19.1.0"
-    react-datepicker: "npm:^8.2.1"
-    react-dom: "npm:^19.1.0"
+    react: "npm:^19.0.0"
+    react-datepicker: "npm:^8.2.0"
+    react-dom: "npm:^19.0.0"
     react-scripts: "npm:5.0.1"
   languageName: unknown
   linkType: soft
@@ -10857,9 +10857,9 @@ __metadata:
   languageName: node
   linkType: hard
 
-"react-datepicker@npm:^8.2.1":
-  version: 8.2.1
-  resolution: "react-datepicker@npm:8.2.1"
+"react-datepicker@npm:^8.2.0":
+  version: 8.2.0
+  resolution: "react-datepicker@npm:8.2.0"
   dependencies:
     "@floating-ui/react": "npm:^0.27.3"
     clsx: "npm:^2.1.1"
@@ -10867,7 +10867,7 @@ __metadata:
   peerDependencies:
     react: ^16.9.0 || ^17 || ^18 || ^19 || ^19.0.0-rc
     react-dom: ^16.9.0 || ^17 || ^18 || ^19 || ^19.0.0-rc
-  checksum: 10c0/a4665b51d138789f2ab43716e157ef1d6a1241ea6a8c2300ec18925ef773fc598592d700ba124631dff18a5077d254941f0d618090f587d853db406220e3a008
+  checksum: 10c0/5efdb79334df548e56778738cbc9448918d5f8547fc29e22725c01493c8221a6e6d474240c8c4823752f5770b0c5db5c9ed2c122bf7472b23678df3891b393b1
   languageName: node
   linkType: hard
 
@@ -10903,14 +10903,14 @@ __metadata:
   languageName: node
   linkType: hard
 
-"react-dom@npm:^19.1.0":
-  version: 19.1.0
-  resolution: "react-dom@npm:19.1.0"
+"react-dom@npm:^19.0.0":
+  version: 19.0.0
+  resolution: "react-dom@npm:19.0.0"
   dependencies:
-    scheduler: "npm:^0.26.0"
+    scheduler: "npm:^0.25.0"
   peerDependencies:
-    react: ^19.1.0
-  checksum: 10c0/3e26e89bb6c67c9a6aa86cb888c7a7f8258f2e347a6d2a15299c17eb16e04c19194e3452bc3255bd34000a61e45e2cb51e46292392340432f133e5a5d2dfb5fc
+    react: ^19.0.0
+  checksum: 10c0/a36ce7ab507b237ae2759c984cdaad4af4096d8199fb65b3815c16825e5cfeb7293da790a3fc2184b52bfba7ba3ff31c058c01947aff6fd1a3701632aabaa6a9
   languageName: node
   linkType: hard
 
@@ -11016,10 +11016,10 @@ __metadata:
   languageName: node
   linkType: hard
 
-"react@npm:^19.1.0":
-  version: 19.1.0
-  resolution: "react@npm:19.1.0"
-  checksum: 10c0/530fb9a62237d54137a13d2cfb67a7db6a2156faed43eecc423f4713d9b20c6f2728b026b45e28fcd72e8eadb9e9ed4b089e99f5e295d2f0ad3134251bdd3698
+"react@npm:^19.0.0":
+  version: 19.0.0
+  resolution: "react@npm:19.0.0"
+  checksum: 10c0/9cad8f103e8e3a16d15cb18a0d8115d8bd9f9e1ce3420310aea381eb42aa0a4f812cf047bb5441349257a05fba8a291515691e3cb51267279b2d2c3253f38471
   languageName: node
   linkType: hard
 
@@ -11463,10 +11463,10 @@ __metadata:
   languageName: node
   linkType: hard
 
-"scheduler@npm:^0.26.0":
-  version: 0.26.0
-  resolution: "scheduler@npm:0.26.0"
-  checksum: 10c0/5b8d5bfddaae3513410eda54f2268e98a376a429931921a81b5c3a2873aab7ca4d775a8caac5498f8cbc7d0daeab947cf923dbd8e215d61671f9f4e392d34356
+"scheduler@npm:^0.25.0":
+  version: 0.25.0
+  resolution: "scheduler@npm:0.25.0"
+  checksum: 10c0/a4bb1da406b613ce72c1299db43759526058fdcc413999c3c3e0db8956df7633acf395cb20eb2303b6a65d658d66b6585d344460abaee8080b4aa931f10eaafe
   languageName: node
   linkType: hard
 
diff --git a/package.json b/package.json
index 3367bd64..f167eb61 100644
--- a/package.json
+++ b/package.json
@@ -54,7 +54,7 @@
     "@testing-library/user-event": "14.6.1",
     "@types/eslint": "^9.6.1",
     "@types/jest": "^29.5.14",
-    "@types/node": "22.13.14",
+    "@types/node": "22.13.5",
     "@types/react": "^19.0.8",
     "@types/react-dom": "^19.0.3",
     "@typescript-eslint/eslint-plugin": "^8.22.0",
diff --git a/src/day.tsx b/src/day.tsx
index 49c59ff6..1c28426a 100644
--- a/src/day.tsx
+++ b/src/day.tsx
@@ -312,7 +312,6 @@ export default class Day extends Component<DayProps> {
     if (
       selectsEnd &&
       startDate &&
-      !endDate &&
       (isAfter(selectingDate, startDate) || isEqual(selectingDate, startDate))
     ) {
       return isDayInRange(day, startDate, selectingDate);
diff --git a/src/time.tsx b/src/time.tsx
index 4e1bb3d5..c6ed61e4 100644
--- a/src/time.tsx
+++ b/src/time.tsx
@@ -62,6 +62,7 @@ export default class Time extends Component<TimeProps, TimeState> {
     );
   };
 
+  private resizeObserver?: ResizeObserver;
   state: TimeState = {
     height: null,
   };
@@ -69,11 +70,11 @@ export default class Time extends Component<TimeProps, TimeState> {
   componentDidMount(): void {
     // code to ensure selected time will always be in focus within time window when it first appears
     this.scrollToTheSelectedTime();
-    if (this.props.monthRef && this.header) {
-      this.setState({
-        height: this.props.monthRef.clientHeight - this.header.clientHeight,
-      });
-    }
+    this.observeDatePickerHeightChanges();
+  }
+
+  componentWillUnmount(): void {
+    this.resizeObserver?.disconnect();
   }
 
   private header?: HTMLDivElement;
@@ -82,6 +83,27 @@ export default class Time extends Component<TimeProps, TimeState> {
 
   private centerLi?: HTMLLIElement;
 
+  private observeDatePickerHeightChanges(): void {
+    const { monthRef } = this.props;
+    this.updateContainerHeight();
+
+    if (monthRef) {
+      this.resizeObserver = new ResizeObserver(() => {
+        this.updateContainerHeight();
+      });
+
+      this.resizeObserver.observe(monthRef);
+    }
+  }
+
+  private updateContainerHeight(): void {
+    if (this.props.monthRef && this.header) {
+      this.setState({
+        height: this.props.monthRef.clientHeight - this.header.clientHeight,
+      });
+    }
+  }
+
   scrollToTheSelectedTime = (): void => {
     requestAnimationFrame((): void => {
       if (!this.list) return;
diff --git a/src/year.tsx b/src/year.tsx
index 8bbfad18..a32c3e7d 100644
--- a/src/year.tsx
+++ b/src/year.tsx
@@ -38,8 +38,6 @@ interface YearProps
   ) => void;
   preSelection?: Date | null;
   setPreSelection?: (date?: Date | null) => void;
-  selectsMultiple?: boolean;
-  selectedDates?: Date[];
   selected?: Date | null;
   inline?: boolean;
   usePointerEvent?: boolean;
@@ -242,15 +240,6 @@ export default class Year extends Component<YearProps> {
     );
   };
 
-  isSelectedYear = (year: number) => {
-    const { selectsMultiple, selected, selectedDates } = this.props;
-
-    if (selectsMultiple) {
-      return selectedDates?.some((date) => year === getYear(date));
-    }
-    return !selected || year === getYear(selected);
-  };
-
   onYearClick = (
     event:
       | React.MouseEvent<HTMLDivElement, MouseEvent>
@@ -371,6 +360,7 @@ export default class Year extends Component<YearProps> {
       date,
       minDate,
       maxDate,
+      selected,
       excludeDates,
       includeDates,
       filterDate,
@@ -382,7 +372,9 @@ export default class Year extends Component<YearProps> {
       `react-datepicker__year-${y}`,
       date ? yearClassName?.(setYear(date, y)) : undefined,
       {
-        "react-datepicker__year-text--selected": this.isSelectedYear(y),
+        "react-datepicker__year-text--selected": selected
+          ? y === getYear(selected)
+          : undefined,
         "react-datepicker__year-text--disabled":
           (minDate || maxDate || excludeDates || includeDates || filterDate) &&
           isYearDisabled(y, this.props),
diff --git a/yarn.lock b/yarn.lock
index f48dda25..ecbaca4a 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1760,8 +1760,8 @@ __metadata:
   linkType: hard
 
 "@floating-ui/react@npm:^0.27.3":
-  version: 0.27.5
-  resolution: "@floating-ui/react@npm:0.27.5"
+  version: 0.27.4
+  resolution: "@floating-ui/react@npm:0.27.4"
   dependencies:
     "@floating-ui/react-dom": "npm:^2.1.2"
     "@floating-ui/utils": "npm:^0.2.9"
@@ -1769,7 +1769,7 @@ __metadata:
   peerDependencies:
     react: ">=17.0.0"
     react-dom: ">=17.0.0"
-  checksum: 10c0/2da91779fddd3f368bfec0ceeb67b98e7b73f07b27f56f5ae339169de9c4145851ed432469d5dd81b99b9d6a5f0fefbb4ea8c881d2c97dd2dc0a0e96ad0945dd
+  checksum: 10c0/d1456de8e72b5127c76f59ec3f9a53f216125bd9146eea82adf1df24eea884039522477c98fe65cb095be77b4c3c20f91c3433a70c9243e1a4714a1055470f77
   languageName: node
   linkType: hard
 
@@ -2999,12 +2999,12 @@ __metadata:
   languageName: node
   linkType: hard
 
-"@types/node@npm:22.13.14":
-  version: 22.13.14
-  resolution: "@types/node@npm:22.13.14"
+"@types/node@npm:22.13.5":
+  version: 22.13.5
+  resolution: "@types/node@npm:22.13.5"
   dependencies:
     undici-types: "npm:~6.20.0"
-  checksum: 10c0/fa2ab5b8277bfbcc86c42e46a3ea9871b0d559894cc9d955685d17178c9499f0b1bf03d1d1ea8d92ef2dda818988f4035acb8abf9dc15423a998fa56173ab804
+  checksum: 10c0/a2e7ed7bb0690e439004779baedeb05159c5cc41ef6d81c7a6ebea5303fde4033669e1c0e41ff7453b45fd2fea8dbd55fddfcd052950c7fcae3167c970bca725
   languageName: node
   linkType: hard
 
@@ -3108,18 +3108,18 @@ __metadata:
   linkType: hard
 
 "@typescript-eslint/parser@npm:^8.22.0":
-  version: 8.28.0
-  resolution: "@typescript-eslint/parser@npm:8.28.0"
+  version: 8.25.0
+  resolution: "@typescript-eslint/parser@npm:8.25.0"
   dependencies:
-    "@typescript-eslint/scope-manager": "npm:8.28.0"
-    "@typescript-eslint/types": "npm:8.28.0"
-    "@typescript-eslint/typescript-estree": "npm:8.28.0"
-    "@typescript-eslint/visitor-keys": "npm:8.28.0"
+    "@typescript-eslint/scope-manager": "npm:8.25.0"
+    "@typescript-eslint/types": "npm:8.25.0"
+    "@typescript-eslint/typescript-estree": "npm:8.25.0"
+    "@typescript-eslint/visitor-keys": "npm:8.25.0"
     debug: "npm:^4.3.4"
   peerDependencies:
     eslint: ^8.57.0 || ^9.0.0
-    typescript: ">=4.8.4 <5.9.0"
-  checksum: 10c0/4bde6887bbf3fe031c01e46db90f9f384a8cac2e67c2972b113a62d607db75e01db943601279aac847b9187960a038981814042cb02fd5aa27ea4613028f9313
+    typescript: ">=4.8.4 <5.8.0"
+  checksum: 10c0/9a54539ba297791f23093ff42a885cc57d36b26205d7a390e114d1f01cc584ce91ac6ead01819daa46b48f873cac6c829fcf399a436610bdbfa98e5cd78148a2
   languageName: node
   linkType: hard
 
@@ -3133,6 +3133,16 @@ __metadata:
   languageName: node
   linkType: hard
 
+"@typescript-eslint/scope-manager@npm:8.25.0":
+  version: 8.25.0
+  resolution: "@typescript-eslint/scope-manager@npm:8.25.0"
+  dependencies:
+    "@typescript-eslint/types": "npm:8.25.0"
+    "@typescript-eslint/visitor-keys": "npm:8.25.0"
+  checksum: 10c0/0a53a07873bdb569be38053ec006009cc8ba6b12c538b6df0935afd18e431cb17da1eb15b0c9cd267ac211c47aaa44fbc8d7ff3b7b44ff711621ff305fa3b355
+  languageName: node
+  linkType: hard
+
 "@typescript-eslint/scope-manager@npm:8.26.1":
   version: 8.26.1
   resolution: "@typescript-eslint/scope-manager@npm:8.26.1"
@@ -3143,16 +3153,6 @@ __metadata:
   languageName: node
   linkType: hard
 
-"@typescript-eslint/scope-manager@npm:8.28.0":
-  version: 8.28.0
-  resolution: "@typescript-eslint/scope-manager@npm:8.28.0"
-  dependencies:
-    "@typescript-eslint/types": "npm:8.28.0"
-    "@typescript-eslint/visitor-keys": "npm:8.28.0"
-  checksum: 10c0/f3bd76b3f54e60f1efe108b233b2d818e44ecf0dc6422cc296542f784826caf3c66d51b8acc83d8c354980bd201e1d9aa1ea01011de96e0613d320c00e40ccfd
-  languageName: node
-  linkType: hard
-
 "@typescript-eslint/type-utils@npm:8.26.1":
   version: 8.26.1
   resolution: "@typescript-eslint/type-utils@npm:8.26.1"
@@ -3175,6 +3175,13 @@ __metadata:
   languageName: node
   linkType: hard
 
+"@typescript-eslint/types@npm:8.25.0":
+  version: 8.25.0
+  resolution: "@typescript-eslint/types@npm:8.25.0"
+  checksum: 10c0/b39addbee4be4d66e3089c2d01f9f1d69cedc13bff20e4fa9ed0ca5a0e7591d7c6e41ab3763c8c35404f971bc0fbf9f7867dbc2832740e5b63ee0049d60289f5
+  languageName: node
+  linkType: hard
+
 "@typescript-eslint/types@npm:8.26.1":
   version: 8.26.1
   resolution: "@typescript-eslint/types@npm:8.26.1"
@@ -3182,13 +3189,6 @@ __metadata:
   languageName: node
   linkType: hard
 
-"@typescript-eslint/types@npm:8.28.0":
-  version: 8.28.0
-  resolution: "@typescript-eslint/types@npm:8.28.0"
-  checksum: 10c0/1f95895e20dac1cf063dc93c99142fd1871e53be816bcbbee93f22a05e6b2a82ca83c20ce3a551f65555910aa0956443a23268edbb004369d0d5cb282d13c377
-  languageName: node
-  linkType: hard
-
 "@typescript-eslint/typescript-estree@npm:8.19.1":
   version: 8.19.1
   resolution: "@typescript-eslint/typescript-estree@npm:8.19.1"
@@ -3207,12 +3207,12 @@ __metadata:
   languageName: node
   linkType: hard
 
-"@typescript-eslint/typescript-estree@npm:8.26.1":
-  version: 8.26.1
-  resolution: "@typescript-eslint/typescript-estree@npm:8.26.1"
+"@typescript-eslint/typescript-estree@npm:8.25.0":
+  version: 8.25.0
+  resolution: "@typescript-eslint/typescript-estree@npm:8.25.0"
   dependencies:
-    "@typescript-eslint/types": "npm:8.26.1"
-    "@typescript-eslint/visitor-keys": "npm:8.26.1"
+    "@typescript-eslint/types": "npm:8.25.0"
+    "@typescript-eslint/visitor-keys": "npm:8.25.0"
     debug: "npm:^4.3.4"
     fast-glob: "npm:^3.3.2"
     is-glob: "npm:^4.0.3"
@@ -3220,17 +3220,17 @@ __metadata:
     semver: "npm:^7.6.0"
     ts-api-utils: "npm:^2.0.1"
   peerDependencies:
-    typescript: ">=4.8.4 <5.9.0"
-  checksum: 10c0/adc95e4735a8ded05ad35d7b4fae68c675afdd4b3531bc4a51eab5efe793cf80bc75f56dfc8022af4c0a5b316eec61f8ce6b77c2ead45fc675fea7e28cd52ade
+    typescript: ">=4.8.4 <5.8.0"
+  checksum: 10c0/fc9de1c4f6ab81fb80b632dedef84d1ecf4c0abdc5f5246698deb6d86d5c6b5d582ef8a44fdef445bf7fbfa6658db516fe875c9d7c984bf4802e3a508b061856
   languageName: node
   linkType: hard
 
-"@typescript-eslint/typescript-estree@npm:8.28.0":
-  version: 8.28.0
-  resolution: "@typescript-eslint/typescript-estree@npm:8.28.0"
+"@typescript-eslint/typescript-estree@npm:8.26.1":
+  version: 8.26.1
+  resolution: "@typescript-eslint/typescript-estree@npm:8.26.1"
   dependencies:
-    "@typescript-eslint/types": "npm:8.28.0"
-    "@typescript-eslint/visitor-keys": "npm:8.28.0"
+    "@typescript-eslint/types": "npm:8.26.1"
+    "@typescript-eslint/visitor-keys": "npm:8.26.1"
     debug: "npm:^4.3.4"
     fast-glob: "npm:^3.3.2"
     is-glob: "npm:^4.0.3"
@@ -3239,7 +3239,7 @@ __metadata:
     ts-api-utils: "npm:^2.0.1"
   peerDependencies:
     typescript: ">=4.8.4 <5.9.0"
-  checksum: 10c0/97a91c95b1295926098c12e2d2c2abaa68994dc879da132dcce1e75ec9d7dee8187695eaa5241d09cbc42b5e633917b6d35c624e78e3d3ee9bda42d1318080b6
+  checksum: 10c0/adc95e4735a8ded05ad35d7b4fae68c675afdd4b3531bc4a51eab5efe793cf80bc75f56dfc8022af4c0a5b316eec61f8ce6b77c2ead45fc675fea7e28cd52ade
   languageName: node
   linkType: hard
 
@@ -3283,23 +3283,23 @@ __metadata:
   languageName: node
   linkType: hard
 
-"@typescript-eslint/visitor-keys@npm:8.26.1":
-  version: 8.26.1
-  resolution: "@typescript-eslint/visitor-keys@npm:8.26.1"
+"@typescript-eslint/visitor-keys@npm:8.25.0":
+  version: 8.25.0
+  resolution: "@typescript-eslint/visitor-keys@npm:8.25.0"
   dependencies:
-    "@typescript-eslint/types": "npm:8.26.1"
+    "@typescript-eslint/types": "npm:8.25.0"
     eslint-visitor-keys: "npm:^4.2.0"
-  checksum: 10c0/51b1016d06cd2b9eac0a213de418b0a26022fd3b71478014541bfcbc2a3c4d666552390eb9c209fa9e52c868710d9f1b21a2c789d35c650239438c366a27a239
+  checksum: 10c0/7eb84c5899a25b1eb89d3c3f4be3ff18171f934669c57e2530b6dfa5fdd6eaae60629f3c89d06f4c8075fd1c701de76c0b9194e2922895c661ab6091e48f7db9
   languageName: node
   linkType: hard
 
-"@typescript-eslint/visitor-keys@npm:8.28.0":
-  version: 8.28.0
-  resolution: "@typescript-eslint/visitor-keys@npm:8.28.0"
+"@typescript-eslint/visitor-keys@npm:8.26.1":
+  version: 8.26.1
+  resolution: "@typescript-eslint/visitor-keys@npm:8.26.1"
   dependencies:
-    "@typescript-eslint/types": "npm:8.28.0"
+    "@typescript-eslint/types": "npm:8.26.1"
     eslint-visitor-keys: "npm:^4.2.0"
-  checksum: 10c0/245a78ed983fe95fbd1b0f2d4cb9e9d1d964bddc0aa3e3d6ab10c19c4273855bfb27d840bb1fd55deb7ae3078b52f26592472baf6fd2c7019a5aa3b1da974f35
+  checksum: 10c0/51b1016d06cd2b9eac0a213de418b0a26022fd3b71478014541bfcbc2a3c4d666552390eb9c209fa9e52c868710d9f1b21a2c789d35c650239438c366a27a239
   languageName: node
   linkType: hard
 
@@ -4305,9 +4305,9 @@ __metadata:
   linkType: hard
 
 "core-js@npm:^3.40.0":
-  version: 3.41.0
-  resolution: "core-js@npm:3.41.0"
-  checksum: 10c0/a29ed0b7fe81acf49d04ce5c17a1947166b1c15197327a5d12f95bbe84b46d60c3c13de701d808f41da06fa316285f3f55ce5903abc8d5642afc1eac4457afc8
+  version: 3.40.0
+  resolution: "core-js@npm:3.40.0"
+  checksum: 10c0/db7946ada881e845d8b157061945b1187618fa45cf162f392a151e8a497962aed2da688c982eaa1d444c864be97a70f8be4d73385294b515d224dd164d19f1d4
   languageName: node
   linkType: hard
 
@@ -7298,8 +7298,8 @@ __metadata:
   linkType: hard
 
 "lint-staged@npm:^15.4.3":
-  version: 15.5.0
-  resolution: "lint-staged@npm:15.5.0"
+  version: 15.4.3
+  resolution: "lint-staged@npm:15.4.3"
   dependencies:
     chalk: "npm:^5.4.1"
     commander: "npm:^13.1.0"
@@ -7313,7 +7313,7 @@ __metadata:
     yaml: "npm:^2.7.0"
   bin:
     lint-staged: bin/lint-staged.js
-  checksum: 10c0/393b24d85d705a36e6556dc9d9b710594163be60f7789a2ca71bbf8f31debc10f7fde9cd0e868466ac2b7c154661983602decd7abbb6c685b21007bc70dbbdd6
+  checksum: 10c0/c1f71f2273bcbd992af929620f5acc6b9f6899da4b395e780e0b3ab33a0d725c239eb961873067c8c842e057c585c71dd4d44c0dc8b25539d3c2e97a3bdd6f30
   languageName: node
   linkType: hard
 
@@ -8691,7 +8691,7 @@ __metadata:
     "@testing-library/user-event": "npm:14.6.1"
     "@types/eslint": "npm:^9.6.1"
     "@types/jest": "npm:^29.5.14"
-    "@types/node": "npm:22.13.14"
+    "@types/node": "npm:22.13.5"
     "@types/react": "npm:^19.0.8"
     "@types/react-dom": "npm:^19.0.3"
     "@typescript-eslint/eslint-plugin": "npm:^8.22.0"


Test patch:
diff --git a/src/test/calendar_test.test.tsx b/src/test/calendar_test.test.tsx
index 81ac627b..8d281466 100644
--- a/src/test/calendar_test.test.tsx
+++ b/src/test/calendar_test.test.tsx
@@ -45,6 +45,7 @@ import {
   SafeElementWrapper,
   safeQuerySelector,
   safeQuerySelectorAll,
+  setupMockResizeObserver,
 } from "./test_utils";
 
 import type { ReactDatePickerCustomHeaderProps } from "../calendar";
@@ -136,6 +137,10 @@ describe("Calendar", () => {
     };
   }
 
+  beforeAll(() => {
+    setupMockResizeObserver();
+  });
+
   it("should start with the current date in view if no date range", () => {
     const now = newDate();
     const { instance } = getCalendar();
diff --git a/src/test/datepicker_test.test.tsx b/src/test/datepicker_test.test.tsx
index d820374e..21548de0 100644
--- a/src/test/datepicker_test.test.tsx
+++ b/src/test/datepicker_test.test.tsx
@@ -29,7 +29,11 @@ import DatePicker, { registerLocale } from "../index";
 import CustomInput from "./helper_components/custom_input";
 import ShadowRoot from "./helper_components/shadow_root";
 import TestWrapper from "./helper_components/test_wrapper";
-import { getKey, safeQuerySelector } from "./test_utils";
+import {
+  getKey,
+  safeQuerySelector,
+  setupMockResizeObserver,
+} from "./test_utils";
 
 function getSelectedDayNode(container: HTMLElement) {
   return (
@@ -56,14 +60,6 @@ function goToLastMonth(container: HTMLElement) {
   fireEvent.click(lastMonthButton!);
 }
 
-function goToNextMonth(container: HTMLElement) {
-  const nextMonthButton = safeQuerySelector(
-    container,
-    ".react-datepicker__navigation-icon--next",
-  );
-  fireEvent.click(nextMonthButton!);
-}
-
 function formatDayWithZeros(day: number) {
   const dayString = day.toString();
 
@@ -91,6 +87,10 @@ const showDocument = (calendarInput: HTMLElement) => {
 };
 
 describe("DatePicker", () => {
+  beforeEach(() => {
+    setupMockResizeObserver();
+  });
+
   afterEach(() => {
     jest.resetAllMocks();
   });
@@ -3117,65 +3117,6 @@ describe("DatePicker", () => {
     });
   });
 
-  describe("is-selecting-range", () => {
-    const IN_RANGE_DAY_CLASS_NAME = "react-datepicker__day--in-selecting-range";
-
-    it("should apply '--in-selecting-range' class to the days till the preselected keyboard date on navigating to the next month without selecting endDate in the endDatePicker", () => {
-      const preselectedDay = 5;
-      const startDate = new Date(`2025/02/${preselectedDay}`);
-
-      const { container } = render(
-        <DatePicker
-          inline
-          selectsEnd
-          startDate={startDate}
-          minDate={startDate}
-        />,
-      );
-
-      goToNextMonth(container);
-
-      for (let i = 1; i <= preselectedDay; i++) {
-        const inSelectionRangeDay = safeQuerySelector(
-          container,
-          `.react-datepicker__day--00${i}`,
-        );
-        expect(
-          inSelectionRangeDay.classList.contains(IN_RANGE_DAY_CLASS_NAME),
-        ).toBe(true);
-      }
-    });
-
-    it("should not apply '--in-selecting-range' class to the days till the date that matched selectedDate in the next months (endDatePicker)", () => {
-      const startDay = 3;
-      const endDay = 8;
-      const startDate = new Date(`2025/02/${startDay}`);
-      const endDate = new Date(`2025/02/${endDay}`);
-
-      const { container } = render(
-        <DatePicker
-          inline
-          selectsEnd
-          startDate={startDate}
-          endDate={endDate}
-          minDate={startDate}
-        />,
-      );
-
-      goToNextMonth(container);
-
-      for (let i = 1; i <= endDay; i++) {
-        const inSelectionRangeDay = safeQuerySelector(
-          container,
-          `.react-datepicker__day--00${i}`,
-        );
-        expect(
-          inSelectionRangeDay.classList.contains(IN_RANGE_DAY_CLASS_NAME),
-        ).toBe(false);
-      }
-    });
-  });
-
   describe("selectsRange without inline", () => {
     it("should have preSelection set to startDate upon opening", () => {
       const startDate = new Date("2021-04-20 00:00:00");
diff --git a/src/test/day_test.test.tsx b/src/test/day_test.test.tsx
index a17775c0..12d2692a 100644
--- a/src/test/day_test.test.tsx
+++ b/src/test/day_test.test.tsx
@@ -688,13 +688,15 @@ describe("Day", () => {
     });
 
     describe("for an end date picker", () => {
-      it("should highlight all dates after the start date (if the endDate is not selected yet)", () => {
-        const { startDate } = createDateRange(-1, 1);
+      it("should highlight for dates after the start date", () => {
+        const { startDate, endDate } = createDateRange(-1, 1);
 
+        // All these should highlight: today, tomorrow (endDate), the day after
         for (let daysFromStart = 1; daysFromStart <= 3; daysFromStart++) {
           const day = addDays(startDate, daysFromStart);
           const container = renderDay(day, {
             startDate,
+            endDate,
             selectingDate: day,
             selectsEnd: true,
           });
diff --git a/src/test/exclude_time_period_test.test.tsx b/src/test/exclude_time_period_test.test.tsx
index 6531bf64..68bc3acc 100644
--- a/src/test/exclude_time_period_test.test.tsx
+++ b/src/test/exclude_time_period_test.test.tsx
@@ -2,9 +2,14 @@ import { render } from "@testing-library/react";
 import React from "react";
 
 import { newDate, setTime } from "../date_utils";
+import { setupMockResizeObserver } from "./test_utils";
 import DatePicker from "../index";
 
 describe("DatePicker", () => {
+  beforeAll(() => {
+    setupMockResizeObserver();
+  });
+
   it("should only display times between minTime and maxTime", () => {
     const now = newDate();
     const { container } = render(
diff --git a/src/test/exclude_times_test.test.tsx b/src/test/exclude_times_test.test.tsx
index 69745a3e..d477d808 100644
--- a/src/test/exclude_times_test.test.tsx
+++ b/src/test/exclude_times_test.test.tsx
@@ -2,11 +2,16 @@ import { render } from "@testing-library/react";
 import React from "react";
 
 import { setTime, newDate } from "../date_utils";
+import { setupMockResizeObserver } from "./test_utils";
 import DatePicker from "../index";
 
 describe("DatePicker", () => {
   let now: Date, excludeTimes: Date[];
 
+  beforeAll(() => {
+    setupMockResizeObserver();
+  });
+
   beforeEach(() => {
     now = newDate();
     excludeTimes = [
diff --git a/src/test/min_time_test.test.tsx b/src/test/min_time_test.test.tsx
index 2eaf280c..d7056952 100644
--- a/src/test/min_time_test.test.tsx
+++ b/src/test/min_time_test.test.tsx
@@ -3,7 +3,7 @@ import React, { useState } from "react";
 
 import DatePicker from "../index";
 
-import { safeQuerySelector } from "./test_utils";
+import { safeQuerySelector, setupMockResizeObserver } from "./test_utils";
 
 import type { DatePickerProps } from "../index";
 
@@ -44,6 +44,10 @@ const DatePickerWithState = (
 };
 
 describe("Datepicker minTime", () => {
+  beforeAll(() => {
+    setupMockResizeObserver();
+  });
+
   it("should select time 12:00 AM when no minTime constraint is set.", () => {
     const { getByText, container } = render(<DatePickerWithState />);
 
diff --git a/src/test/show_time_test.test.tsx b/src/test/show_time_test.test.tsx
index 0fdfbf44..a64a4785 100644
--- a/src/test/show_time_test.test.tsx
+++ b/src/test/show_time_test.test.tsx
@@ -4,9 +4,13 @@ import React from "react";
 import DatePicker from "../index";
 import TimeComponent from "../time";
 
-import { safeQuerySelector } from "./test_utils";
+import { safeQuerySelector, setupMockResizeObserver } from "./test_utils";
 
 describe("DatePicker", () => {
+  beforeAll(() => {
+    setupMockResizeObserver();
+  });
+
   it("should show time component when showTimeSelect prop is present", () => {
     const { container } = render(<DatePicker showTimeSelect open />);
     const timeComponent = container.querySelector(
diff --git a/src/test/test_utils.ts b/src/test/test_utils.ts
index 54f8073c..83e075a0 100644
--- a/src/test/test_utils.ts
+++ b/src/test/test_utils.ts
@@ -123,6 +123,37 @@ export const safeQuerySelectorAll = <T extends HTMLElement = HTMLElement>(
   return elements;
 };
 
+let _resizeObserverCallbackFn: ResizeObserverCallback | null;
+
+export const getResizeObserverCallback = () => _resizeObserverCallbackFn;
+
+export const setupMockResizeObserver = () => {
+  const mockObserve = jest.fn();
+  const mockDisconnect = jest.fn();
+  const mockUnobserve = jest.fn();
+
+  const ResizeObserverMock = jest.fn((fn) => {
+    _resizeObserverCallbackFn = fn;
+
+    return {
+      observe: mockObserve,
+      disconnect: () => {
+        _resizeObserverCallbackFn = null;
+        mockDisconnect();
+      },
+      unobserve: jest.fn(),
+    };
+  });
+
+  global.ResizeObserver = ResizeObserverMock;
+
+  return {
+    observe: mockObserve,
+    disconnect: mockDisconnect,
+    unobserve: mockUnobserve,
+  };
+};
+
 export class SafeElementWrapper<T extends HTMLElement> {
   constructor(private element: T) {}
 
diff --git a/src/test/time_input_test.test.tsx b/src/test/time_input_test.test.tsx
index bc332753..ef4bf1d7 100644
--- a/src/test/time_input_test.test.tsx
+++ b/src/test/time_input_test.test.tsx
@@ -5,9 +5,13 @@ import DatePicker from "../index";
 import InputTimeComponent from "../input_time";
 
 import CustomTimeInput from "./helper_components/custom_time_input";
-import { safeQuerySelector } from "./test_utils";
+import { safeQuerySelector, setupMockResizeObserver } from "./test_utils";
 
 describe("timeInput", () => {
+  beforeEach(() => {
+    setupMockResizeObserver();
+  });
+
   afterEach(() => {
     jest.resetAllMocks();
   });
diff --git a/src/test/timepicker_test.test.tsx b/src/test/timepicker_test.test.tsx
index 3ed6d043..b4c8010f 100644
--- a/src/test/timepicker_test.test.tsx
+++ b/src/test/timepicker_test.test.tsx
@@ -6,9 +6,11 @@ import DatePicker from "../index";
 
 import {
   getKey,
+  getResizeObserverCallback,
   SafeElementWrapper,
   safeQuerySelector,
   safeQuerySelectorAll,
+  setupMockResizeObserver,
 } from "./test_utils";
 
 const MIN_TIME_LI_LEN = 2;
@@ -19,10 +21,65 @@ describe("TimePicker", () => {
   let onChangeMoment: Date | undefined;
   let instance: DatePicker | null = null;
 
+  let mockObserve: jest.Mock, mockDisconnect: jest.Mock;
+
+  beforeAll(() => {
+    const { observe, disconnect } = setupMockResizeObserver();
+    mockObserve = observe;
+    mockDisconnect = disconnect;
+  });
+
   beforeEach(() => {
     div = document.createElement("div");
   });
 
+  describe("Re-adjust height on Calendar Height Change", () => {
+    beforeEach(() => {
+      mockObserve.mockReset();
+      mockDisconnect.mockReset();
+    });
+
+    it("calls observe on mount", async () => {
+      render(
+        <DatePicker
+          inline
+          selected={new Date()}
+          showTimeSelect
+          timeIntervals={15}
+        />,
+      );
+      await waitFor(() => {
+        expect(mockObserve).toHaveBeenCalledTimes(1);
+
+        const resizeObserverCallback = getResizeObserverCallback();
+        const mockObserveElement = mockObserve.mock.calls[0][0];
+        expect(typeof resizeObserverCallback).toBe("function");
+
+        if (resizeObserverCallback) {
+          resizeObserverCallback([], mockObserveElement);
+        }
+      });
+    });
+
+    it("calls disconnect on unmount", async () => {
+      const component = render(
+        <DatePicker
+          inline
+          selected={new Date()}
+          showTimeSelect
+          timeIntervals={15}
+        />,
+      );
+
+      component.unmount();
+      await waitFor(() => {
+        expect(mockDisconnect).toHaveBeenCalledTimes(1);
+        const resizeObserverCallback = getResizeObserverCallback();
+        expect(resizeObserverCallback).toBe(null);
+      });
+    });
+  });
+
   it("should update on input time change", () => {
     renderDatePicker("February 28, 2018 4:43 PM");
     expect(getInputString()).toBe("February 28, 2018 4:43 PM");
diff --git a/src/test/year_picker_test.test.tsx b/src/test/year_picker_test.test.tsx
index 440c9bc3..3ff0e4e8 100644
--- a/src/test/year_picker_test.test.tsx
+++ b/src/test/year_picker_test.test.tsx
@@ -107,47 +107,6 @@ describe("YearPicker", () => {
     expect(year).toBe(getYear(date).toString());
   });
 
-  it("should has selected class applied for all the selectedDates when selectsMultiple is set", () => {
-    const selectedDates = [new Date("2025-01-01"), new Date("2026-01-01")];
-    const { container } = render(
-      <Year
-        selectsMultiple
-        selectedDates={selectedDates}
-        date={selectedDates[0]}
-        onYearMouseEnter={() => {}}
-        onYearMouseLeave={() => {}}
-      />,
-    );
-    const yearElements = Array.from(
-      container.querySelectorAll(".react-datepicker__year-text--selected"),
-    );
-
-    expect(yearElements.length).toBe(selectedDates.length);
-
-    const isSelectedDatesHighlighted = yearElements.every((yearElement) => {
-      const yearValue = yearElement?.textContent;
-      return selectedDates.some(
-        (selectedDate) => getYear(selectedDate).toString() === yearValue,
-      );
-    });
-    expect(isSelectedDatesHighlighted).toBe(true);
-  });
-
-  it("should not has selected class where there is no selectedDates when selectsMultiple is set", () => {
-    const { container } = render(
-      <Year
-        selectsMultiple
-        date={new Date()}
-        onYearMouseEnter={() => {}}
-        onYearMouseLeave={() => {}}
-      />,
-    );
-    const yearElements = Array.from(
-      container.querySelectorAll(".react-datepicker__year-text--selected"),
-    );
-    expect(yearElements.length).toBe(0);
-  });
-
   it("should have current year class when element of array equal of current year", () => {
     const date = new Date();
     const { container } = render(