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

Safari widget closing not working #28

Closed
mspringer1 opened this issue Aug 13, 2023 · 8 comments
Closed

Safari widget closing not working #28

mspringer1 opened this issue Aug 13, 2023 · 8 comments

Comments

@mspringer1
Copy link

When adding a new widget or configuring an existing widget in Safari on iOS, tapping on the background to close the setup modals does not work. The only way to get back to the default view is to reload the page, restart the web app or to remove the widget.

Tested under iOS 16.5.1 on an iPhone and iPad.

@MoffKalast
Copy link
Owner

MoffKalast commented Aug 13, 2023

Hmm, I've heard of this issue before but I don't currently have any devices capable of running Safari on hand to reproduce it. Would you be up for trying a few things to try and pinpoint what's causing it?

Looking at the related css classes, the most likely culprit is the pointer-events: auto; line in modal_outer, which if removed or set to none or inherit causes similar behaviour in chrome and firefox (clicking does nothing, the main view gets events instead). It should be supported on webkit as well, but maybe auto doesn't quite work there. Most of the other options listed here seem to get good results on chrome, so all, fill, stroke and probably some others would likely be working alternatives if they work on safari.

Another idea might be to try commenting out the lines of the noselect class which prevents selecting text when dragging, maybe one of the webkit ones is interfering with touch events.

If neither of these works then we'll have to get more creative I guess 😄

@mspringer1
Copy link
Author

I tried to test the changes but wasn't really successful

Trying pointer-events:

  • pointer-events: all;: does not make a difference

  • pointer-events: fill;: does not make a difference

  • pointer-events: stroke;: does not make a difference

Trying noselect class:

  • commenting out the webkit classes does not make a difference but just allows to select the text in the webpage
  • commenting out the all classes has the same effect

is there anything else i could test?

@MoffKalast
Copy link
Owner

Hmm well I've set up a branch safari-modal-fix that removes pointer-events entirely and instead has the modal container element expand on demand and always capture clicks. That ought to work I think, can you give it a test?

@mspringer1
Copy link
Author

I just tested the safar-modal-fix branch and unfortunately it is still the same behavior when closing a widget.

I also noticed a transparent circle icon that sometimes appears at the tapped area in safari. Maybe a magnifying glass function.
iphone_screenshot

@MoffKalast
Copy link
Owner

Ok if it really is magnifying glass related, then it may require some kind of preventDefault in the event chain that's calling it by default. I've pushed another change that adds the closing listeners directly onto the elements, and stops any propagation.

@MoffKalast
Copy link
Owner

@mspringer1 I've mentioned this issue to a friend of mine who has a mac, and it may turn out to be as simple as changing window to document in the listener part. If #29 if fixes it we can just go with that instead.

@mspringer1
Copy link
Author

I just tested the updated safari-modal-fix branch and now its working fine. I could also test #29

@mspringer1
Copy link
Author

Tried #29 and this fix also working on iPhone or iPad

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

No branches or pull requests

2 participants