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'
338
338
import EmojiPicker from ' ./EmojiPicker'
339
339
340
340
const { messagesValid } = require (' ../utils/roomValidation' )
341
- const { detectMobile } = require (' ../utils/mobileDetection' )
341
+ const { detectMobile , iOSDevice } = require (' ../utils/mobileDetection' )
342
342
import typingText from ' ../utils/typingText'
343
343
344
344
export default {
@@ -690,15 +690,21 @@ export default {
690
690
this .resetMessage (true )
691
691
},
692
692
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
+ )
702
708
},
703
709
messageActionHandler ({ action, message }) {
704
710
switch (action .name ) {
Original file line number Diff line number Diff line change @@ -21,3 +21,10 @@ function getUserAgent() {
21
21
22
22
return userAgent
23
23
}
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