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

feat(cdk/stepper): emit event when the user interacts with a step #22400

Merged
merged 1 commit into from
Apr 13, 2021

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Apr 5, 2021

Adds an interacted event that will emit when the user tries to move away from a step.

Fixes #19918.

@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: minor This PR is targeted for the next minor release labels Apr 5, 2021
@crisbeto crisbeto requested a review from mmalerba April 5, 2021 12:42
@google-cla google-cla bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Apr 5, 2021
interacted = false;

/** Emits when the user has attempted to move away from the step. */
@Output('interacted') interactedStream: EventEmitter<CdkStep> = new EventEmitter<CdkStep>();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little on the fence about the naming here. I think that interacted sounds more like an event name, but we already used it for the interacted property. I'm open to other naming suggestions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to call it touched or is this a slightly different idea?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It sort of is like touched, but I was trying to avoid using the same terminology is forms to avoid confusion.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interacted sounds fine to me, but I think we normally call our streams xChanges

cc @jelbourn in case he has any naming opinions

@crisbeto crisbeto force-pushed the 19918/stepper-interacted-event branch 3 times, most recently from 5588975 to 9710d3f Compare April 9, 2021 06:33
interacted = false;

/** Emits when the user has attempted to move away from the step. */
@Output('interacted') interactedStream: EventEmitter<CdkStep> = new EventEmitter<CdkStep>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interacted sounds fine to me, but I think we normally call our streams xChanges

cc @jelbourn in case he has any naming opinions

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interacted isn't my favorite API, but I don't have anything better

@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Apr 12, 2021
Adds an `interacted` event that will emit when the user tries to move away from a step.

Fixes angular#19918.
@crisbeto crisbeto force-pushed the 19918/stepper-interacted-event branch from 9710d3f to 3611b0f Compare April 12, 2021 17:11
@mmalerba mmalerba merged commit 9b4c503 into angular:master Apr 13, 2021
@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 May 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fr(MatStepper): No notification mechanism on step interacted without a step change.
3 participants