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

Fix window size on iOS - UX issue #5

Open
epolidor opened this issue Oct 3, 2018 · 9 comments
Open

Fix window size on iOS - UX issue #5

epolidor opened this issue Oct 3, 2018 · 9 comments
Labels
bug Something isn't working hacktoberfest
Projects

Comments

@epolidor
Copy link
Member

epolidor commented Oct 3, 2018

When opening the keyboard on iOS the chat window gets wrong resized. Also, when closing the window the chat window size is not getting back to the correct size.

To reproduce the issue visit https://seedtoken.io/demo and open the keyboard of your mobile device. After talking with the bot close the keyboard. After that on some devices the window size will not be correct.

The issue will be fixed if the window after closing the keyboard goes back to the regular size (full mobile screen).

It is possible to test the code of hadron at https://codepen.io/BotanicTechnologies/pen/WarGxm

@epolidor epolidor added the bug Something isn't working label Oct 3, 2018
@epolidor epolidor added this to To Do in Sprout via automation Oct 3, 2018
@SEEDToken SEEDToken changed the title Fix resize window on mobile devices when closing the keyboard Fix resize window on iOS when closing keyboard Oct 3, 2018
@SEEDToken SEEDToken changed the title Fix resize window on iOS when closing keyboard Fix resize window on mobile devices when closing the keyboard Oct 3, 2018
@shad-k
Copy link
Collaborator

shad-k commented Oct 3, 2018

@SEEDToken would like to have a go at it, if it's fine.

@shad-k
Copy link
Collaborator

shad-k commented Oct 4, 2018

@SEEDToken I am not able to replicate this on any of my devices. Can you help me with replicating this?

@SEEDToken SEEDToken changed the title Fix resize window on mobile devices when closing the keyboard Fix window size on iOS - UX issue Oct 9, 2018
@windfee
Copy link
Contributor

windfee commented Oct 9, 2018

@shad-k it seems to be happening only on iOS devices. I can reproduce it on my iPhone 6 with iOS 11.4.1.

What happens:

  • on your iPhone in Safari, go to seedtoken.io/demo (or any other page on seedtoken.io) and open the bot by clicking the bubble icon in the lower right corner
  • type any text into the text entry field
  • depending on text length, you either see nothing, because the window does not scroll OR (long bot response) you'll see only parts of the bot response.

Reason: the whole bot window scrolls up instead of the content inside.

Screenshots:
seedbot_ios_start
This looks good: Start screen of the bot

seedbot_ios_window_scrolledup
Instead of the content, the whole window scrolls out of screen (you can't see the logo anymore)

What should happen:
seedbot_ios_content_scrolledup
the content inside the bot window should scroll.

Possible solutions:

  1. resize window (reduce size) and only scroll the content inside the window (possible UX problem: window would be too small for most bot responses)
  2. automatically close keyboard after each [return]
  3. any better UX idea

Example: it works fine on Android phones. @epolidor could you please provide screenshots as examples how the UX on Android looks?

@epolidor
Copy link
Member Author

epolidor commented Oct 9, 2018

On Android the window is resized once the keyboard is open.

screenshot_samsung internet

@shad-k
Copy link
Collaborator

shad-k commented Oct 14, 2018

@consiliera I guess making the bot window scroll is the best option. It will cause the problem that long bot responses would require a scroll but that is still a better UX than closing the window on return IMO.

@windfee
Copy link
Contributor

windfee commented Oct 15, 2018

@consiliera I guess making the bot window scroll is the best option. It will cause the problem that long bot responses would require a scroll but that is still a better UX than closing the window on return IMO.

@shad-k Okay, and please keep in mind how it looks on Android (epolidor's screen shot above): the bot window is shorter (but keeps the header).

Are you ready to go then or do you need anything to get started? Just let me know!

@shad-k
Copy link
Collaborator

shad-k commented Oct 16, 2018

@consiliera I am ready to go. Will make a PR soon.

@shad-k
Copy link
Collaborator

shad-k commented Oct 25, 2018

While looking through this issue for the past some days, I have found multiple sources stating that Safari doesn't fire the resize event when the virtual keyboard is opened. Neither does it resize the window as Chrome does. Thus, there is no definitive solution to this problem as there is no way to figure out the height of the keyboard across all the iOS devices. If we could know the height somehow, the approach would be as follows:

  • Add an event listener for the focus event on textarea
  • Whenever the textarea is in focus add a class which sets the top: height-of-keyboard for the bot window header.
  • Remove the class from within a blur event listener on `

But this above approach is hacky and doesn't provide the full solution.

Please advise on what can be done.

@windfee
Copy link
Contributor

windfee commented Oct 29, 2018

While looking through this issue for the past some days, I have found multiple sources stating that Safari doesn't fire the resize event when the virtual keyboard is opened. Neither does it resize the window as Chrome does. Thus, there is no definitive solution to this problem as there is no way to figure out the height of the keyboard across all the iOS devices. If we could know the height somehow, the approach would be as follows:

  • Add an event listener for the focus event on textarea
  • Whenever the textarea is in focus add a class which sets the top: height-of-keyboard for the bot window header.
  • Remove the class from within a blur event listener on `

But this above approach is hacky and doesn't provide the full solution.

Please advise on what can be done.

@epolidor Can you please advise shad-k? Do you have another idea perhaps? Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hacktoberfest
Projects
Sprout
  
To Do
Development

No branches or pull requests

4 participants