goetzrobin / spartan

Cutting-edge tools powering Angular full-stack development.
https://spartan.ng
MIT License
1.29k stars 137 forks source link

Opening sheet triggers twice #102

Closed jstnjs closed 8 months ago

jstnjs commented 8 months ago

Please provide the environment you discovered this bug in.

Clean install of the repo.

Which area/package is the issue in?

sheet

Description

Hey,

I was tinkering with the sheet component and saw something interesting. When you click on the sheet component in Storybook and then click on the "Edit Profile" button. Opening the sheet actually triggers twice.

This is because in the BrnSheetTriggerDirective, we listen to the click on the host and execute the open method, which triggers opening the sheet once.

But the BrnSheetTriggerDirective is also extending the BrnDialogTriggerDirective which listens for a click as well and executes the open method.

I think we can remove the line '(click)': 'open()', from the BrnSheetTriggerDirective, since it's already defined within the BrnDialogTriggerDirective. Maybe we could remove the other duplications as well or am I missing something?

I can create a PR if you guys agree :)

Please provide the exception or error you saw

Log the `open` method in `BrnSheetTriggerDirective` and see it triggering twice.

Other information

No response

I would be willing to submit a PR to fix this issue

goetzrobin commented 8 months ago

That's correct! Great catch! Here is some more info: https://github.com/angular/angular/issues/33632

@jstnjs do you want me to fix this or do you want to open a PR and claim your spot as part of the 300? 😄

Let me know and I'll assign you the issue!

jstnjs commented 8 months ago

I'll claim my spot 😎 Created PR #108.