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

Add check for startPos to fix #7864 #8462

Merged
merged 2 commits into from
Jul 11, 2019

Conversation

msbarry
Copy link
Contributor

@msbarry msbarry commented Jul 11, 2019

Add check for startPos to fix #7864.

This falls back to ignoring click tolerance and just firing the click event in the case where startPos is not defined. I've been running with it in production for a few months and have not seen the error since then.

@msbarry msbarry changed the title 7864 threshold error Add check for startPos to fix #7864 Jul 11, 2019
const canvas = map.getCanvas();

const MouseEvent = window(canvas).MouseEvent;
const event = new MouseEvent('click', {bubbles: true, clientX: 100, clientY: 100});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alternatively we could expose a simulate.fakeClick utility, but I didn't think we'd want to encourage anyone to re-use that since it only applies to a corner case.

Copy link
Member

@mourner mourner left a comment

Choose a reason for hiding this comment

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

👍 Thanks for the fix!

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.

Marker element click event throws: Uncaught TypeError: Cannot read property 'x' of null
2 participants