MoffKalast / vizanti

A mission planner and visualizer for controlling outdoor ROS robots.
https://wiki.ros.org/vizanti
BSD 3-Clause "New" or "Revised" License
134 stars 26 forks source link

Safari widget closing not working #28

Closed mspringer1 closed 10 months ago

mspringer1 commented 10 months ago

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 commented 10 months ago

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 commented 10 months ago

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

Trying pointer-events:

Trying noselect class:

is there anything else i could test?

MoffKalast commented 10 months ago

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 commented 10 months ago

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 commented 10 months ago

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 commented 10 months ago

@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 windowto documentin the listener part. If #29 if fixes it we can just go with that instead.

mspringer1 commented 10 months ago

I just tested the updated safari-modal-fix branch and now its working fine. I could also test https://github.com/MoffKalast/vizanti/pull/29

mspringer1 commented 10 months ago

Tried https://github.com/MoffKalast/vizanti/pull/29 and this fix also working on iPhone or iPad