JSFiddle - React, Tailwind, and code Playground

HTML

<input id='email' type='text'>

JavaScript

const input = document.getElementById('email');
const defaultEmail = '@gmail.com';
input.value = defaultEmail;

function handleInput() {
	const val = input.value;
  const sel = input.selectionStart;
  if (val.length - defaultEmail.length < sel) {
  	input.value = val.slice(0, sel)
    input.removeEventListener('input', handleInput);
		input.removeEventListener('focus', handleInput);
    input.removeEventListener('click', handleInput);
    
  }
  
}

input.addEventListener('input', handleInput);
input.addEventListener('focus', handleInput);
input.addEventListener('click', handleInput);