Skip to content

IgxDateRangePicker fails to compile with strict type checks #16437

@ddaribo

Description

@ddaribo

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: 20.2.x, 20.1.x
  • 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.

Metadata

Metadata

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions