Skip to content

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

@TheColorRed

Description

@TheColorRed

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>'.

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

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

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4A relatively minor issue that is not relevant to core functionsarea: material/bottom-sheet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions