Skip to content

[2.1.0] Problem on mobile when catalog gallery allowfullscreen is false #5808

Closed
@peec

Description

@peec

This is repost of #2818 since that one got closed due to incorrect bug report guidelines. I have the same issue.

Preconditions

  1. Magento 2.1.0 GA
  2. PHP 7.0.3
  3. MySQL 5.6
  4. Linux Mint
  5. Tested in browser: Chrome latest ( mobile view )

Steps to reproduce

  1. In theme's view.xml, set gallery's allowfullscreen variable to false.
  2. Flush cache and static files.
  3. Go to a product page with an image on a mobile touch capable device, or minimize the screen to mobile view in chrome. Tap on the image.

Expected result

  1. Nothing should happen when image is clicked since "allowfullscreen" is false.

Actual result

A white page ( the page-wrapper is hidden ).

image

I found that in lib/mage/gallery/gallery.js, even when allowfullscreen = false may be preventing the popup, code is still being executed that hides the page-wrapper.

if (this.isTouchEnabled) {
    this.settings.$element.on('tap', '.fotorama__stage__frame', function () {
        var translate = getTranslate($(this).parents('.fotorama__stage__shaft'));

        if (translate[1] === '0' && !$(this).hasClass('fotorama-video-container')) {
            self.openFullScreen();
            self.settings.$pageWrapper.hide();
        }
    });
}

Best case would probably be to check allowfullscreen prior to self.settings.$pageWrapper.hide();

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: FrontendFixed in 2.1.xThe issue has been fixed in 2.1 release lineIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentbug report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions