79621435

Date: 2025-05-14 12:17:41
Score: 0.5
Natty:
Report link

This is the most common pattern:

const handleFocus = (e: React.FocusEvent<HTMLInputElement>) => {
  e.target.scrollIntoView({ behavior: 'smooth', block: 'center' });
};

And this you use the onFocus function

<input type="text" onFocus={handleFocus} />
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Elias Salom