question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Mobile device, gestures - modal content is inaccesible for about a second

See original GitHub issue

I’m submitting a …

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter

Current behavior I use HammerJS for gestures. There is an event handler for press (touch & hold) and swipeleft. I’m using those events to open a modal with couple buttons. Click event of those buttons is inactive for (I think) a second, maybe half. I had to click twice after modal shows up. Same behavior if I want to dismiss a modal instantly after shows up. Also the X button in header has same behavior. If I attach same modal to a button, without gestures, just click, anywhere on the page, everything is fine.

Expected behavior It should be accesible instantly after show.

Reproduction of the problem Try interact with modal content opened by any hammerjs event.

Please tell us about your environment: Windows 10 1809, Visual Studio Code, npm, ng serve

  • Smart Modal version: 0.8.x 7.1.1

  • Angular version: 2.0.x 7.2.8

  • Browser: 72.0.3626.121 Windows and Android

  • Language: TypeScript

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:14 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
troncomputerscommented, Apr 2, 2019

@maximelafarie The issue is only on mobile. You have to enable mobile view in Chrome if you’re doing this on a PC. There is no issue in normal, desktop mode. Try this modification:

  ngAfterViewInit() {
    this.ngxSmartModal.get('DocumentOptions').onOpen.subscribe(() => {
      // this.looper = setInterval(() => {
      //   document.getElementById('edit-btn').click();
      // }, 100);
    });

    this.ngxSmartModal.get('DocumentOptions').onAnyCloseEvent.subscribe(() => {
      if (!!this.looper) {
        clearInterval(this.looper);
        this.Counter = 0;
      }
    });
  }

  tap() {
    this.Counter++;
  }

  count() {
    this.Counter--;
  }
        <div class="col-12">
          <button
            id="edit-btn"
            style="border-radius:15px"
            class="btn btn-block btn-new-primary mt-2"
            (click)="count()"
            (tap)="tap()"
            >Edit</button
          >
          <button
            style="border-radius:15px"
            class="btn btn-block btn-new-primary mt-2"
                        (click)="count()"
                                    (tap)="tap()"
            >Print</button
          >
          <button
            style="border-radius:15px"
            class="btn btn-block btn-new-primary mt-2"
                        (click)="count()"
                                    (tap)="tap()"
            >Cash</button
          >
          <button
            style="border-radius:15px"
            class="btn btn-block btn-new-remove mt-2"
                        (click)="count()"
                                    (tap)="tap()"
            >Delete</button
          >
        </div>

Click/Tap immediately after modal shows up. You will see that at the second click/tap your counter will be decremented and stay on last number.

I made a short video with behavior that I have 😃 Youtube Video

2reactions
troncomputerscommented, Mar 28, 2019

Hi! @maximelafarie The example that I provided uses only hammerjs and ngx-smart-modal and its behavior is the same as in my app. I guess it might be problem with hammerjs and gestures events. I didn’t check their code but I think there is some kind of timeout for press and swipe because those events are based on how long you hold or how far you swipe. Well… I like your smart-modal so I need to try/find another gesture library or fix problems. Thx for help 👍 great job 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

6-STEP MOBILE APP ACCESSIBILITY CHECKLIST
These gestures can be simple (such as a one-finger tap) or complex (involving multiple fingers, multiple taps, and drawn shapes).
Read more >
Bootstrap Modal popping up but has a "tinted" page and can't ...
First of all you need to close the modal dialog and open the print dialog after few seconds. setTimeout(function() { printnow('printdiv', 10); }, ......
Read more >
How to Handle Safe Area Insets for iPhone X, iPad X, Android P
More and more mobile devices feature a notch (or display cutout). This guide shows how to use safe area insets to handle it...
Read more >
Alerts - Presentation - Human Interface Guidelines - Design
For example, when a server connection is unavailable, Mail displays an ... alert is a modal view that can look different in different...
Read more >
Common Mobile Application Accessibility Issues to Avoid ...
Furthermore, developers often don't restrict keyboard and screen reader focus within the main content area, even though that area has been ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found