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

fix(toggle): avoid interfering with external click listener #299

Merged
merged 1 commit into from
Apr 21, 2022

Conversation

alfaproject
Copy link
Contributor

Currently the picker toggle's click listener is on the inner button element and we
call stopPropagation on it in order to prevent the form field from focusing the input.
The problem is that doing so will also prevent any custom click handler that the user
might have added to the mat-datetimepicker-toggle.

These changes resolve the issue by moving the listener directly onto the toggle host
which will invoke any external listeners while still allowing us to stop its propagation.

Currently the picker toggle's `click` listener is on the inner `button` element and we
call `stopPropagation` on it in order to prevent the form field from focusing the input.
The problem is that doing so will also prevent any custom `click` handler that the user
might have added to the `mat-datetimepicker-toggle`.

These changes resolve the issue by moving the listener directly onto the toggle host
which will invoke any external listeners while still allowing us to stop its propagation.
@bbortt
Copy link
Collaborator

bbortt commented Apr 21, 2022

great job @alfaproject, many thanks.

@bbortt bbortt merged commit befc986 into kuhnroyal:release Apr 21, 2022
@alfaproject alfaproject deleted the toggle-click branch April 21, 2022 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants