Skip to content

Conversation

@zhangbiggs
Copy link

@zhangbiggs zhangbiggs commented Oct 19, 2022

Apple M1 Pro
safari: Version 16.0 (17614.1.25.9.10, 17614)
Can't find variable: TouchEvent in safari

closes #76

@tbouffard
Copy link
Member

tbouffard commented Oct 19, 2022

Hi @zhangbihua and thanks for your contributions
Does the error you see look like something similar to the Firefox issue described in #76?
Could you provide the stack trace please?

Thanks in advance
[UPDATE] answer in #76 (comment)

Copy link
Member

@tbouffard tbouffard left a comment

Choose a reason for hiding this comment

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

✔️ Tested on Ubuntu 20 Desktop with Firefox 105.0 and the webkit version provided by playwright v1.27.0 (WebKit 16.0).
I didn't see errors in webkit prior the changes provided by this PR, so testing with webkit on Ubuntu is probably not relevant.

I will let this PR opened for a few days to let others test the changes with Safari and on mobile prior I merge.

@tbouffard tbouffard marked this pull request as draft October 23, 2022 09:38
@tbouffard
Copy link
Member

@zhangbihua you recently push new commits that are not related to the fix for Safari and Firefox, could you revert them and tell us what you think about the @mayorovad 's proposal (#127 (comment))?

@zhangbiggs
Copy link
Author

@tbouffard @mayorovad
This is about fixing other bugs, not about this issue. My negligence has caused your workload. I'm really sorry. I will revert as soon as possible and establish new branch in my repo.

Regarding about the @mayorovad 's proposal, I guess mouseEvent is more generic than TouchEvent in different devices

isMouseEvent(this.evt) || (window.TouchEvent && this.evt instanceof TouchEvent)

May be more effective

@tbouffard
Copy link
Member

@zhangbihua thanks for removing extra commit
About your proposal, it's fine to me. The most important thing is to have the window.TouchEvent guard prior invoking TouchEvent

@tbouffard tbouffard changed the title fix: Can't find variable: TouchEvent in safari fix: TouchEvent is not available in Safari and Firefox Desktop Nov 8, 2022
tbouffard and others added 2 commits November 20, 2022 20:51
Co-authored-by: Анатолий Майоров <mayorov.ad@outlook.com>
@tbouffard tbouffard marked this pull request as ready for review November 20, 2022 19:59
@tbouffard
Copy link
Member

As a first implementation, I commited the proposal described in #127 (review). It is known as working and I wanted the fix to be integrated in the upcoming release.
Feel free to open a new Pull Request with another implementation if this one didn't fit well.

@tbouffard tbouffard merged commit 92aef9b into maxGraph:development Nov 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TouchEvent is not defined error with Firefox Desktop / Can't find variable: TouchEvent error with Safari Desktop

3 participants