File tree Expand file tree Collapse file tree 2 files changed +23
-10
lines changed Expand file tree Collapse file tree 2 files changed +23
-10
lines changed Original file line number Diff line number Diff line change @@ -338,7 +338,7 @@ import SvgIcon from './SvgIcon'
338338import EmojiPicker from ' ./EmojiPicker'
339339
340340const { messagesValid } = require (' ../utils/roomValidation' )
341- const { detectMobile } = require (' ../utils/mobileDetection' )
341+ const { detectMobile , iOSDevice } = require (' ../utils/mobileDetection' )
342342import typingText from ' ../utils/typingText'
343343
344344export default {
@@ -690,15 +690,21 @@ export default {
690690 this .resetMessage (true )
691691 },
692692 loadMoreMessages (infiniteState ) {
693- if (this .loadingMoreMessages ) return
694-
695- if (this .messagesLoaded || ! this .room .roomId ) {
696- return infiniteState .complete ()
697- }
698-
699- this .infiniteState = infiniteState
700- this .$emit (' fetch-messages' )
701- this .loadingMoreMessages = true
693+ setTimeout (
694+ () => {
695+ if (this .loadingMoreMessages ) return
696+
697+ if (this .messagesLoaded || ! this .room .roomId ) {
698+ return infiniteState .complete ()
699+ }
700+
701+ this .infiniteState = infiniteState
702+ this .$emit (' fetch-messages' )
703+ this .loadingMoreMessages = true
704+ },
705+ // prevent scroll bouncing issue on iOS devices
706+ iOSDevice () ? 500 : 0
707+ )
702708 },
703709 messageActionHandler ({ action, message }) {
704710 switch (action .name ) {
Original file line number Diff line number Diff line change @@ -21,3 +21,10 @@ function getUserAgent() {
2121
2222 return userAgent
2323}
24+
25+ export function iOSDevice ( ) {
26+ return (
27+ [ 'iPad' , 'iPhone' , 'iPod' ] . includes ( navigator . platform ) ||
28+ ( navigator . userAgent . includes ( 'Mac' ) && 'ontouchend' in document )
29+ )
30+ }
You can’t perform that action at this time.
0 commit comments