Skip to content

refactor: cleanup fake event dispatch utilities #19151

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

Merged

Conversation

devversion
Copy link
Member

Cleans up the fake event dispatch utiltities:

  1. dispatchMouseEvent accepts an actual mouse event. This has been
    introduced with this commit. If a mouse event has already been created,
    then it can be just dispatched, but doesn't need to go through
    dispatchMouseEvent which primarily is a shorthand for creating
    an event and dispatching it.

  2. dispatchEvent helper should use a generic so that we don't
    need to cast events unnecessarily.

  3. createMouseEvent should not accept x and y. This is ambiguous.
    It's not clear what coordinates are expected. To improve this,
    parameters are now explicit, and a better comment has been added.

Cleans up the fake event dispatch utiltities:

1. `dispatchMouseEvent` accepts an actual mouse event. This has been
introduced with [this commit](04bf3d1).
If a mouse event has already been created, then it can be just
dispatched, but doesn't need to go through `dispatchMouseEvent` which
primarily is a shorthand for creating an event and dispatching it.

2. `dispatchEvent` helper should use a generic so that we don't
need to cast events unnecessarily.

3. `createMouseEvent` should not accept `x` and `y`. This is ambiguous.
It's not clear what coordinates are expected. To improve this,
parameters are now explicit, and a better comment has been added.
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Apr 23, 2020
@devversion devversion marked this pull request as ready for review April 23, 2020 10:44
@devversion devversion added the target: patch This PR is targeted for the next patch release label Apr 23, 2020
Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

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

LGTM

@crisbeto crisbeto added lgtm action: merge The PR is ready for merge by the caretaker labels Apr 23, 2020
Copy link
Contributor

@mmalerba mmalerba left a comment

Choose a reason for hiding this comment

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

LGTM

@jelbourn jelbourn merged commit ed4e91d into angular:master Apr 24, 2020
jelbourn pushed a commit that referenced this pull request Apr 24, 2020
Cleans up the fake event dispatch utiltities:

1. `dispatchMouseEvent` accepts an actual mouse event. This has been
introduced with [this commit](04bf3d1).
If a mouse event has already been created, then it can be just
dispatched, but doesn't need to go through `dispatchMouseEvent` which
primarily is a shorthand for creating an event and dispatching it.

2. `dispatchEvent` helper should use a generic so that we don't
need to cast events unnecessarily.

3. `createMouseEvent` should not accept `x` and `y`. This is ambiguous.
It's not clear what coordinates are expected. To improve this,
parameters are now explicit, and a better comment has been added.
soro-google pushed a commit to soro-google/components that referenced this pull request Apr 24, 2020
Cleans up the fake event dispatch utiltities:

1. `dispatchMouseEvent` accepts an actual mouse event. This has been
introduced with [this commit](04bf3d1).
If a mouse event has already been created, then it can be just
dispatched, but doesn't need to go through `dispatchMouseEvent` which
primarily is a shorthand for creating an event and dispatching it.

2. `dispatchEvent` helper should use a generic so that we don't
need to cast events unnecessarily.

3. `createMouseEvent` should not accept `x` and `y`. This is ambiguous.
It's not clear what coordinates are expected. To improve this,
parameters are now explicit, and a better comment has been added.
@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 25, 2020
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 target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants