Skip to content

off canvas menu does not close when clicking outside menu on mobile safari on iOS #555

@level420

Description

@level420

This is for:

T3 plugin v2.7.4
T3 blank template v2.2.8
joomla 3.9.11
iPhone 6 with iOS 12.4

Steps to reproduce the issue:

  1. Create an empty joomla website with the joomla sample data installed.
  2. Install T3 and template T3 blank and activate the off canvas menu in the T3 blank template settings
  3. Open the website on an iPhone using mobile safari
  4. Tap the off canvas burger menu
  5. Tap outside the off canvas menu e.g. in the grey background below the menu items
  6. The off canvas menu does not close as expected

This is due to the fact that mobile safari (in contrary to desktop safari) does not fire a click event for the body tag which is used in t3/base/js/off-canvas.js to trigger the menu close.

Solution:

For mobile safari the menu close handler should also be attached to the touchstart or the tap event, which is fired in this situation in mobile safari.

The fix is simple. I could offer a PR for this if appropriate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions