components icon indicating copy to clipboard operation
components copied to clipboard

bug(bottom-sheet): Config values throw error but work

Open TheColorRed opened this issue 1 year ago • 0 comments

Is this a regression?

  • [ ] Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

When creating a bottom sheet, you cannot pass height, minHeight, maxHeight to the sheet as it throws an error:

Object literal may only specify known properties, and 'maxHeight' does not exist in type 'MatBottomSheetConfig<BottomSheetInjectedData<T>>'.

Object literal may only specify known properties, and 'mixHeight' does not exist in type 'MatBottomSheetConfig<BottomSheetInjectedData<T>>'.

Object literal may only specify known properties, and 'height' does not exist in type 'MatBottomSheetConfig<BottomSheetInjectedData<T>>'.

    this.matRef = this.bottomSheet.open(MyComponent, {
      height: '80vh',
      minHeight: '200px',
      maxHeight: `50vh`,
    });

However, when used with @ts-ignore, the properties works as expected.

Reproduction

StackBlitz link: https://stackblitz.com/edit/stackblitz-starters-fzwkec?file=src%2Fmain.ts Steps to reproduce:

  1. Remove the // @ts-ignore line
  2. An error is thrown

Expected Behavior

These properties should be acceptable.

Actual Behavior

These properties throw errors unless // @ts-ignore is used.

Environment

  • Angular: ^17.2.0
  • CDK/Material: ^17.2.0
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): macOS

TheColorRed avatar Apr 05 '24 19:04 TheColorRed