@@ -528,14 +528,14 @@ export default {
528
528
50
529
529
)
530
530
531
- this .$refs [ ' roomTextarea' ] .addEventListener (' click' , () => {
531
+ this .$refs . roomTextarea .addEventListener (' click' , () => {
532
532
if (isMobile) this .keepKeyboardOpen = true
533
533
534
534
this .updateFooterList (' @' )
535
535
this .updateFooterList (' :' )
536
536
})
537
537
538
- this .$refs [ ' roomTextarea' ] .addEventListener (' blur' , () => {
538
+ this .$refs . roomTextarea .addEventListener (' blur' , () => {
539
539
this .resetFooterList ()
540
540
if (isMobile) setTimeout (() => (this .keepKeyboardOpen = false ))
541
541
})
@@ -633,7 +633,7 @@ export default {
633
633
this .scrollIcon = bottomScroll > 500 || this .scrollMessagesCount
634
634
},
635
635
updateFooterList (tagChar ) {
636
- if (! this .$refs [ ' roomTextarea' ] ) return
636
+ if (! this .$refs . roomTextarea ) return
637
637
638
638
if (
639
639
tagChar === ' @' &&
@@ -643,13 +643,12 @@ export default {
643
643
}
644
644
645
645
if (
646
- this .textareaCursorPosition ===
647
- this .$refs [' roomTextarea' ].selectionStart
646
+ this .textareaCursorPosition === this .$refs .roomTextarea .selectionStart
648
647
) {
649
648
return
650
649
}
651
650
652
- this .textareaCursorPosition = this .$refs [ ' roomTextarea' ] .selectionStart
651
+ this .textareaCursorPosition = this .$refs . roomTextarea .selectionStart
653
652
654
653
let position = this .textareaCursorPosition
655
654
@@ -682,7 +681,7 @@ export default {
682
681
}
683
682
},
684
683
getCharPosition (tagChar ) {
685
- const cursorPosition = this .$refs [ ' roomTextarea' ] .selectionStart
684
+ const cursorPosition = this .$refs . roomTextarea .selectionStart
686
685
687
686
let position = cursorPosition
688
687
while (position > 0 && this .message .charAt (position - 1 ) !== tagChar) {
@@ -780,17 +779,17 @@ export default {
780
779
setTimeout (() => this .focusTextarea (disableMobileFocus))
781
780
},
782
781
resetTextareaSize () {
783
- if (! this .$refs [ ' roomTextarea' ] ) return
784
- this .$refs [ ' roomTextarea' ] .style .height = ' 20px'
782
+ if (! this .$refs . roomTextarea ) return
783
+ this .$refs . roomTextarea .style .height = ' 20px'
785
784
},
786
785
focusTextarea (disableMobileFocus ) {
787
786
if (detectMobile () && disableMobileFocus) return
788
- if (! this .$refs [ ' roomTextarea' ] ) return
789
- this .$refs [ ' roomTextarea' ] .focus ()
787
+ if (! this .$refs . roomTextarea ) return
788
+ this .$refs . roomTextarea .focus ()
790
789
791
790
if (this .cursorRangePosition ) {
792
791
setTimeout (() => {
793
- this .$refs [ ' roomTextarea' ] .setSelectionRange (
792
+ this .$refs . roomTextarea .setSelectionRange (
794
793
this .cursorRangePosition ,
795
794
this .cursorRangePosition
796
795
)
@@ -799,7 +798,7 @@ export default {
799
798
}
800
799
},
801
800
preventKeyboardFromClosing () {
802
- if (this .keepKeyboardOpen ) this .$refs [ ' roomTextarea' ] .focus ()
801
+ if (this .keepKeyboardOpen ) this .$refs . roomTextarea .focus ()
803
802
},
804
803
sendMessage () {
805
804
let message = this .message .trim ()
@@ -941,7 +940,7 @@ export default {
941
940
this .$emit (' typing-message' , this .message )
942
941
}, 100 ),
943
942
resizeTextarea () {
944
- const el = this .$refs [ ' roomTextarea' ]
943
+ const el = this .$refs . roomTextarea
945
944
946
945
if (! el) return
947
946
0 commit comments