Match users using startsWith instead of match.
This commit is contained in:
		
							parent
							
								
									b68ebf3056
								
							
						
					
					
						commit
						74a6df8a55
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -75,7 +75,7 @@ const PostStatusForm = {
 | 
			
		|||
      const firstchar = this.textAtCaret.charAt(0)
 | 
			
		||||
      if (firstchar === '@') {
 | 
			
		||||
        const matchedUsers = filter(this.users, (user) => (String(user.name + user.screen_name)).toUpperCase()
 | 
			
		||||
            .match(this.textAtCaret.slice(1).toUpperCase()))
 | 
			
		||||
            .startsWith(this.textAtCaret.slice(1).toUpperCase()))
 | 
			
		||||
        if (matchedUsers.length <= 0) {
 | 
			
		||||
          return false
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue