Skip to content

There is a bug when click outside #176

@yuzhigang

Description

@yuzhigang

the page slide can't be closed when I click outside once. I have to click twice.

       function onBodyClick(e) {
            var target = e.touches && e.touches[0] || e.target;
            if (
              isOpen &&
              body.contains(target) &&
              !slider.contains(target)
            ) {
              isOpen = false;
              scope.psOpen = false;
              scope.$apply();
            }

when function onBodyClick() is called, isOpen is false, so the page slide can‘t be closed.
so, in function psOpen(), we need to insert code after scope.psOpen = true;
isOpen = true;
I change it, it works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions