Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 11, 2025

Closes #16437

Description

IgxDateRangePickerComponent.getEditElement() returned HTMLInputElement | undefined, incompatible with base class PickerBaseDirective which defines HTMLInputElement. Applications with strict TypeScript checks failed to compile.

// Before - compilation error with strict checks public getEditElement(): HTMLInputElement | undefined { return this.inputDirective?.nativeElement; } // After - matches base class signature public getEditElement(): HTMLInputElement { return this.inputDirective!.nativeElement; }

The optional chaining was unnecessary: getEditElement() is only called when hasProjectedInputs is false, at which point inputDirective is guaranteed to exist in the rendered template.

Additional information (check all that apply):

  • Bug fix
  • New functionality
  • Documentation
  • Demos
  • CI/CD

Checklist:

  • All relevant tags have been applied to this PR
  • This PR includes unit tests covering all the new code (test guidelines)
  • This PR includes API docs for newly added methods/properties (api docs guidelines)
  • This PR includes feature/README.MD updates for the feature docs
  • This PR includes general feature table updates in the root README.MD
  • This PR includes CHANGELOG.MD updates for newly added functionality
  • This PR contains breaking changes
  • This PR includes ng update migrations for the breaking changes (migrations guidelines)
  • This PR includes behavioral changes and the feature specification has been updated with them

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • accounts.google.com
    • Triggering command: /home/REDACTED/.cache/puppeteer/chrome/linux-136.0.7103.94/chrome-linux64/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=3904 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-83250547 --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,14400582546214623126,5943833251440008836,262144 --disable-features=PaintHolding --variations-seed-version (dns block)
    • Triggering command: /home/REDACTED/.cache/puppeteer/chrome/linux-136.0.7103.94/chrome-linux64/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=3906 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-97812633 --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,17779351793697573338,6741410952299742747,262144 --disable-features=PaintHolding --variations-seed-version (dns block)
    • Triggering command: /home/REDACTED/.cache/puppeteer/chrome/linux-136.0.7103.94/chrome-linux64/chrome --user-data-dir=/tmp/karma-83250547 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications --no-sandbox --disable-gpu --window-size=820,800 --js-flags=--expose-gc --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 --noerrdialogs --ozone-platform=headless --ozone-override-screen-size=800,600 --use-angle=swiftshader-webgl http://localhost:9876/?id=83250547 (dns block)
  • clients2.google.com
    • Triggering command: /home/REDACTED/.cache/puppeteer/chrome/linux-136.0.7103.94/chrome-linux64/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=3906 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-97812633 --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,17779351793697573338,6741410952299742747,262144 --disable-features=PaintHolding --variations-seed-version (dns block)
    • Triggering command: /home/REDACTED/.cache/puppeteer/chrome/linux-136.0.7103.94/chrome-linux64/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=3904 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-83250547 --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,14400582546214623126,5943833251440008836,262144 --disable-features=PaintHolding --variations-seed-version (dns block)
    • Triggering command: /home/REDACTED/.cache/puppeteer/chrome/linux-136.0.7103.94/chrome-linux64/chrome --user-data-dir=/tmp/karma-83250547 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications --no-sandbox --disable-gpu --window-size=820,800 --js-flags=--expose-gc --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 --noerrdialogs --ozone-platform=headless --ozone-override-screen-size=800,600 --use-angle=swiftshader-webgl http://localhost:9876/?id=83250547 (dns block)
  • redirector.gvt1.com
    • Triggering command: /home/REDACTED/.cache/puppeteer/chrome/linux-136.0.7103.94/chrome-linux64/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=3904 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-83250547 --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,14400582546214623126,5943833251440008836,262144 --disable-features=PaintHolding --variations-seed-version (dns block)
    • Triggering command: /home/REDACTED/.cache/puppeteer/chrome/linux-136.0.7103.94/chrome-linux64/chrome --user-data-dir=/tmp/karma-83250547 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications --no-sandbox --disable-gpu --window-size=820,800 --js-flags=--expose-gc --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 --noerrdialogs --ozone-platform=headless --ozone-override-screen-size=800,600 --use-angle=swiftshader-webgl http://localhost:9876/?id=83250547 (dns block)
    • Triggering command: /home/REDACTED/.cache/puppeteer/chrome/linux-136.0.7103.94/chrome-linux64/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=3906 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-97812633 --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,17779351793697573338,6741410952299742747,262144 --disable-features=PaintHolding --variations-seed-version (dns block)
  • www.google.com
    • Triggering command: /home/REDACTED/.cache/puppeteer/chrome/linux-136.0.7103.94/chrome-linux64/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=3906 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-97812633 --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,17779351793697573338,6741410952299742747,262144 --disable-features=PaintHolding --variations-seed-version (dns block)
    • Triggering command: /home/REDACTED/.cache/puppeteer/chrome/linux-136.0.7103.94/chrome-linux64/chrome --user-data-dir=/tmp/karma-97812633 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications --no-sandbox --disable-gpu --window-size=820,800 --js-flags=--expose-gc --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 --noerrdialogs --ozone-platform=headless --ozone-override-screen-size=800,600 --use-angle=swiftshader-webgl http://localhost:9876/?id=97812633 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>IgxDateRangePicker fails to compile with strict type checks</issue_title>
<issue_description>## Description
After the recent refactor, an additional type of undefined was added for the getEditElement() of the DRP (ref), which causes a compilation error, due to a mismatch with the base definition. The PickerBaseDirective implementations across the library assume the edit element exists:

 /** @hidden @internal */ public getEditElement() { return this.inputDirective.nativeElement; } 
  • igniteui-angular version: latest
  • browser: any

Steps to reproduce

  1. Open this sample

Result

X [ERROR] TS2416: Property 'getEditElement' in type 'IgxDateRangePickerComponent' is not assignable to the same property in base type 'PickerBaseDirective'. Type '() => HTMLInputElement | undefined' is not assignable to type '() => HTMLInputElement'. Type 'HTMLInputElement | undefined' is not assignable to type 'HTMLInputElement'. Type 'undefined' is not assignable to type 'HTMLInputElement'. [plugin angular-compiler] node_modules/igniteui-angular/index.d.ts:43610:4: 43610 │ getEditElement(): HTMLInputElement | undefined; 

Expected result

App to compile

Attachments

Attach a sample if available, and screenshots, if applicable.

</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Nov 11, 2025
Copilot AI and others added 2 commits November 11, 2025 12:11
Co-authored-by: ddaribo <35433937+ddaribo@users.noreply.github.com>
Co-authored-by: ddaribo <35433937+ddaribo@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix IgxDateRangePicker to compile with strict type checks Fix IgxDateRangePicker type incompatibility with strict TypeScript checks Nov 11, 2025
Copilot AI requested a review from ddaribo November 11, 2025 12:20
Copilot finished work on behalf of ddaribo November 11, 2025 12:20
@ddaribo ddaribo marked this pull request as ready for review November 11, 2025 12:21
@ddaribo
Copy link
Contributor

ddaribo commented Nov 11, 2025

@copilot generate PRs including the same fix for the following base branches: 19.2.x, 20.1.x

Copy link
Contributor Author

Copilot AI commented Nov 11, 2025

@copilot generate PRs including the same fix for the following base branches: 19.2.x, 20.1.x

I'm unable to create multiple PRs targeting different base branches as that requires creating new branches and PRs through GitHub, which is outside my capabilities.

However, I can help you prepare the changes. The fix is a simple 2-line change in date-range-picker.component.ts (lines 874-875):

// Change from: public getEditElement(): HTMLInputElement | undefined { return this.inputDirective?.nativeElement; } // To: public getEditElement(): HTMLInputElement { return this.inputDirective!.nativeElement; }

To create the PRs for 19.2.x and 20.1.x, you can:

  1. Manually create branches from those base branches
  2. Apply the same fix to the corresponding file
  3. Create PRs targeting those branches

Alternatively, you could use git cherry-pick to apply commits bdc776a and 65ffcbe to new branches based on 19.2.x and 20.1.x.

Copilot finished work on behalf of ddaribo November 11, 2025 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants