refactor: replace username old focus logic with the autofocus attribute (#2223)
							parent
							
								
									02db83c72e
								
							
						
					
					
						commit
						2b2c1085fb
					
				| 
						 | 
				
			
			@ -6,10 +6,10 @@
 | 
			
		|||
      <div v-if="error !== ''" class="wrong">{{ error }}</div>
 | 
			
		||||
 | 
			
		||||
      <input
 | 
			
		||||
        autofocus
 | 
			
		||||
        class="input input--block"
 | 
			
		||||
        type="text"
 | 
			
		||||
        autocapitalize="off"
 | 
			
		||||
        ref="username"
 | 
			
		||||
        v-model="username"
 | 
			
		||||
        :placeholder="$t('login.username')"
 | 
			
		||||
      />
 | 
			
		||||
| 
						 | 
				
			
			@ -71,8 +71,6 @@ export default {
 | 
			
		|||
    };
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    this.focusUsername();
 | 
			
		||||
 | 
			
		||||
    if (!recaptcha) return;
 | 
			
		||||
 | 
			
		||||
    window.grecaptcha.ready(function () {
 | 
			
		||||
| 
						 | 
				
			
			@ -82,9 +80,6 @@ export default {
 | 
			
		|||
    });
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    focusUsername() {
 | 
			
		||||
      this.$refs.username.focus();
 | 
			
		||||
    },
 | 
			
		||||
    toggleMode() {
 | 
			
		||||
      this.createMode = !this.createMode;
 | 
			
		||||
    },
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue