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.

bug: sheet modal gesture breaks when interacting with inputs/keyboard on ios

See original GitHub issue

Prequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x

Current Behavior

I just tested the new Sheet Modal. First: Great work 🎉 Here is a Collections of things i mentioned:

  • Similar to #23561: My IDEA (InteliJ) seems to not know the new properties like breakpoints or initialBreakpoint. Maybe missing in the angular component declaration?

  • The handle can not be set to false for Sheet Modals: https://github.com/ionic-team/ionic-framework/blob/9fa373c6efeceb39913f1c158cda383c38cba29c/core/src/components/modal/modal.tsx#L550

  • The handle itself doesn’t looks nice in combination with IonTitle - Looks like it needs a bit more spacing here

  • The Backdrop seems to be a bit buggy yet, see video: After drag finished it changes:

  • When i have an Input inside the Sheet Modal and focus it the Keyboard appears and the Modal pushs up a bit. After losing the focus of the input and the keyboard is gone, the breakpoints do not work anymore and i’m kind of in a free mode where i can stop the Modal wherever i want

  • Where we already talk about that: This freeMode would be a cool feature

  • Also it would be great to be able to disable the possibility to drag the Modal and add the possibility to change the current breakpoint programatically.

Expected Behavior

Everything is described above

Steps to Reproduce

Version: 6.0.0-beta.5

Code Reproduction URL

No response

Ionic Info

No response

Additional Information

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:15 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
EinfachHanscommented, Jan 19, 2022

@liamdebeasi FYI, looks like the canStart of the sheet gesture is called when an input inside of the sheet style modal is clicked and the keyboard opens 🤔

Additional to that, i guess it would make sense to close open keyboards when start dragging by adjusting the canStart:

const canStart = (detail: GestureDetail) => {
  /**
   * If the sheet is fully expanded and
   * the user is swiping on the content,
   * the gesture should not start to
   * allow for scrolling on the content.
   */
  const content = (detail.event.target! as HTMLElement).closest('ion-content');

  if (currentBreakpoint === 1 && content) {
    return false;
  }

  const activeElement = baseEl.ownerDocument!.activeElement as HTMLElement;
  if (activeElement && activeElement.matches('input,ion-input, ion-textarea')) {
    activeElement.blur();
  }

  return true;
};
1reaction
liamdebeasicommented, Sep 14, 2021

Some updates on this:

  1. IDE issue is resolved via https://github.com/ionic-team/ionic-framework/pull/23899
  2. Handle position is resolved via https://github.com/ionic-team/ionic-framework/pull/23901
  3. Disabling handle is resolved via https://github.com/ionic-team/ionic-framework/pull/23900
  4. Backdrop animation when breakpoints does not include 1 is resolved via https://github.com/ionic-team/ionic-framework/pull/23927

The above 4 fixes will be available in an upcoming Ionic v6 beta.

The “bounce” you mentioned in https://github.com/ionic-team/ionic-framework/issues/23878#issuecomment-916126140 will be tracked in https://github.com/ionic-team/ionic-framework/issues/22120 since it also impacts card modals. Programmatically moving the breakpoint is currently being discussed in another thread you have (https://github.com/ionic-team/ionic-framework/issues/23917).

I am going to convert this thread to focus on the remaining issue which is the sheet gesture breaking when Interacting with the keyboard/inputs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

iOS16 Bug Keyboard breaks layout on sheet dismissal SwiftUI
In iOS16 faced a bug with keyboard inside sheet, when sheet is dismissing keyboard disappears(what is ok), but layout is not updated.
Read more >
Handling text interactions in custom keyboards
Handling text interactions in custom keyboards. Insert, delete, and manipulate text by using a proxy to a text input view.
Read more >
5 Examples of the new Ionic 6 Bottom Sheet Modal
The Ionic 6 modal comes with a brand new presentation mode called bottom sheet, which is usually also known as bottom drawer in...
Read more >
How to dismiss the keyboard for a TextField - Hacking with Swift
If you're supporting only iOS 15 and later, you can activate and dismiss the keyboard for a text field by focusing and unfocusing...
Read more >
DHS Section 508 Compliance Test Process for iOS Mobile ...
Keyboard access must be available for all interactive interface components (links, buttons, etc.), editable content (text input fields, select ...
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