-
Notifications
You must be signed in to change notification settings - Fork 308
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
updated to have a click event emitter in HeaderAction #2699
Conversation
✅ Deploy Preview for carbon-components-angular ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
DCO Assistant Lite bot All contributors have signed the DCO. |
I have read the DCO document and I hereby sign the DCO. |
@@ -60,5 +60,6 @@ export class HeaderAction extends BaseIconButton { | |||
this.active = !this.active; | |||
this.selected.emit(this.active); | |||
this.activeChange.emit(this.active); | |||
this.click.emit(this.active); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is redundant. There is a selected
and an activeChange
event emitted with the same data. Instead listening for click event, just listen for selected
or activeChange
event. You can even double bind a variable with [active]
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then is that not an upgrade action that should be documented?
The (click) property on header-action-component seems like it is unused now, and code in the field binding to click breaks when moving from v4 to v5.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just checked, it never emitted a click
event. Only the events I mentioned above were emitted. You can view the v10 files here: https://github.com/carbon-design-system/carbon-components-angular/blob/v10/src/ui-shell/header/header-action.component.ts
You probably were able to capture the event because the click event was bubbled. We stop propagation in icon button so the event doesn't bubble up and cannot be captured. It was never suggested that click
event should've been used in our documentation or storybook hence it was not mentioned in our documentation.
@ParkerMIBM I'm closing this PR as we have alternatives available. |
Closes #2698
Since moving to the base icon button, the click event does not propagate up the chain. This adds the click event as an Output on the BaseIconButton and the emitter within the onClick function in the UIShellModule Header Action Component
Changelog
Changed