Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Interactive keyboard dismiss (like UIScrollView.KeyboardDismissMode Interactive in iOS) #6064

Open
ericbf opened this issue Nov 9, 2022 · 3 comments

Comments

@ericbf
Copy link

ericbf commented Nov 9, 2022

Feature Request

Description

In iOS (at least), you can set the keyboard to dismiss interactively when in a scrolling view (like the messages app, etc). It’d be good to be able to set that behavior in a capacitor app as well.

Platform(s)

iOS (at least), android if there’s an equivalent behavior.

Preferred Solution

A function on the keyboard plugin to enable/disable interactive dismiss or to set the dismiss mode.

Alternatives

Just sudden dismissal of the keyboard when the input loses focus, not being able to dismiss the keyboard by swiping (as the expected behavior for users is)

Additional Context

https://developer.apple.com/documentation/uikit/uiscrollview/keyboarddismissmode

@ericbf

This comment was marked as abuse.

@kimproductions
Copy link

I would love this feature. Need it so badly in my capacitor app

@howlettga
Copy link

This functionality can be managed across both platforms by listening and responding to scroll events on pages with inputs. I think many search/list views use this methodology rather than rely specifically on keyboard swipe down.

This is a workaround and I do think that dismissing keyboard on swipe would be super useful. Particularly on pages like a form where I might want to allow the user to swipe down the keyboard but not necessarily hook into every scroll event.

content.page.html

<ion-header>
  <ion-toolbar>
    <ion-searchbar></ion-searchbar>
  </ion-toolbar>
</ion-header>
<ion-content role="feed" [scrollEvents]="true" (ionScrollStart)=handleScroll"($event)">
  <ion-list>
    ...
  </ion-list>
</ion-content>

content.page.ts

import { Keyboard } from '@capacitor/keyboard';

handleScroll(event: Event) {
  if (event != null) {
    Keyboard.hide();
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants