rpaschoal / ng-chat

💬 A simple facebook/linkedin lookalike chat module for Angular applications.
MIT License
155 stars 92 forks source link

Mobile keyboard problem #144

Open tushar009 opened 4 years ago

tushar009 commented 4 years ago

Chat box is hide when mobile keyboard is open. For your reference please open the below link into the mobile https://angular-pfq4dv.stackblitz.io

rpaschoal commented 4 years ago

Hi @tushar009 ,

Thank you for providing a reproducible link. It seems like a bug to me. This feature was recently introduced by @LuckyGStar so I'm wondering if @LuckyGStar would be keen to take a look into it?

Cheers!

LuckyGStar commented 4 years ago

Hi @tushar009 .

Please refer this pull request. In mobile cases, chat widget is designed to be hidden.

https://github.com/rpaschoal/ng-chat/pull/128

Please let me know if you have any questions.

Cheers!

tushar009 commented 4 years ago

Hi @rpaschoal, @LuckyGStar Thank you for your quick response, i will check and let you know.

tushar009 commented 4 years ago

Hi @LuckyGStar

I have enabled the flag "viewportWidthCalculationEnabled" true still, it is not working. Steps

Please look the below link https://stackblitz.com/edit/angular-qixwan?file=src%2Fapp%2Fapp.component.html

Note - Please be open link "https://angular-qixwan.stackblitz.io/" into the mobile browse

floxcristian commented 3 years ago

Same problem here. 😟

LegendaryJanitor commented 2 years ago

ng-chat code

@rpaschoal, After looking closer at this bug and the code it appears that the bug is coming from the NormalizeWindows() function inside ng-chat component. When the message input on a chat has focus the mobile keyboard will appear. This triggers a resize event and the subsequent NormalizeWindows() function. Depending on the user's screen size the mobile keyboard will take up most of the screen space and the function will calculate that there isn't enough room for the chat and force it to close open chats.

Commenting out the problem line of code on 239 removed the bug. Perhaps adding isViewportOnMobileEnabled to the conditional to not allow it to splice if enabled for an official fix to this bug.