Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 task
TheColorRed opened this issue Apr 5, 2024 · 1 comment · Fixed by #29794 or Mazen-Embaby/components#1
Closed
1 task

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

TheColorRed opened this issue Apr 5, 2024 · 1 comment · Fixed by #29794 or Mazen-Embaby/components#1
Labels
area: material/bottom-sheet P4 A relatively minor issue that is not relevant to core functions

Comments

@TheColorRed
Copy link

TheColorRed commented Apr 5, 2024

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
@TheColorRed TheColorRed added the needs triage This issue needs to be triaged by the team label Apr 5, 2024
@crisbeto crisbeto added P4 A relatively minor issue that is not relevant to core functions area: material/bottom-sheet and removed needs triage This issue needs to be triaged by the team labels Apr 14, 2024
naaajii added a commit to naaajii/components that referenced this issue Sep 27, 2024
…onfig

these properties were missing from the config but still worked as they were passed to dialog under the hood to avoid type errors

fixes angular#28832
naaajii added a commit to naaajii/components that referenced this issue Sep 27, 2024
…onfig

these properties were missing from the config but still worked as they were passed to dialog under the hood to avoid type errors

fixes angular#28832
naaajii added a commit to naaajii/components that referenced this issue Sep 27, 2024
…onfig

these properties were missing from the config but still worked as they were passed to dialog under the hood to avoid type errors

fixes angular#28832
crisbeto pushed a commit that referenced this issue Nov 11, 2024
…onfig (#29794)

these properties were missing from the config but still worked as they were passed to dialog under the hood to avoid type errors

fixes #28832

(cherry picked from commit d4adbaa)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: material/bottom-sheet P4 A relatively minor issue that is not relevant to core functions
Projects
None yet
2 participants