Giter VIP home page Giter VIP logo

Comments (2)

sean-perkins avatar sean-perkins commented on April 28, 2024

Hello @drakedeatonuk thanks for this feature request!

I can see you have also experienced the pain that is trying to animate any content relative to the keyboard position! Based on the current state of technology, this is difficult for anyone to do perfectly in all environments. Devices are notoriously inconsistent with the rendered keyboard height.

We have to use a mixed strategy of starting an animation when the keyboard show event is dispatched and doing a best guess to the animation duration & curve when animating to a fixed position relative to the keyboard height. Almost every implementation I've seen that has tried this either animates their custom content a little off from the keyboard or they wait until the keyboard has fully appeared before revealing an accessory bar.

I will discuss with the team and see if we have opinions on how to best handle this. Due to the limitation of how well we can also do this out of the box, potentially documentation and/or a blog may be better suited so developers can customize the implementation to match their device demographics best.

from ionic-framework.

drakedeatonuk avatar drakedeatonuk commented on April 28, 2024

@sean-perkins I feel like there should be a support group from people who've gone down the custom mobile keyboard content animate rabbit hole!

A blog or a page of documentation on best practices/ different approaches would be very valuable I think. I know long I spent looking for resources and not quite ever finding the help I wanted.

Perhaps some examples of approaches to try could be included too. Recently I've been toying with animating a transform: translateY on a keyboardWillShow event with the keyboardResize mode set to Native - that's been quite a smooth looking transition although there's still some edge cases I need to work out.

There are truly some serious "gotchyas" when it comes to keyboard events too. For example, when a keyboard with auto-fill suggestions at it's top opens, ios actually sends two onWillShow and onDidShow events. This in particular created some headaches for creating animations as it makes it much harder to figure out if keyboard events were, from the users perspective, related to a keyboard appearing, or changing height.

Recently I've been gathering some measurements from ever ios devices as it seems that keyboard heights are always consistently off by a certain amount:

Screenshot 2024-01-30 at 21 32 36

Can I ask, have you guys ever had any luck with this type of approach?

from ionic-framework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.