Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

🍦 Nice little addition to a Laravel validation error: scroll your users back up to the error...

42,746 Aufrufe • vor 2 Jahren •via X (Twitter)

11 Kommentare

Profilbild von Logan Craft
Logan Craftvor 2 Jahren

What if the error is at the bottom of the form? Maybe better to have some JavaScript that looks for the first error in the list by targeting the form then getting the first element with .error class or something…

Profilbild von Caleb Porzio
Caleb Porziovor 2 Jahren

Yeah, I toyed with that too: x-init="$el.closest('form').querySelector('[aria-invalid=\'true\']').closest('label').scrollIntoView()" Kind of a mouth-full lol, but works great

Profilbild von Tuginho
Tuginhovor 2 Jahren

Great for UX!

Profilbild von Swan Company Inc
Swan Company Incvor 2 Jahren

Your making life too easy for people like me but I'll take it! Honestly, I can't wait to show what I've been building with the TALL stack and the day it's profitable I'll be giving back as much as I can for everyone's hard work.

Profilbild von 𝕽𝖎𝖉𝖜𝖆𝖓𝖚𝖑𝖑𝖆𝖍🥰
𝕽𝖎𝖉𝖜𝖆𝖓𝖚𝖑𝖑𝖆𝖍🥰vor 2 Jahren

Cool stuff, Caleb🥰

Profilbild von Ryan Bilesky
Ryan Bileskyvor 2 Jahren

Why can't more apps do this? With how many times I click submit and get an error but don't know it because it's up at the top where am already scrolled passed and take a second to realize what's going on, I can only imagine how normal users must feel.

Profilbild von Λlex Wulf
Λlex Wulfvor 2 Jahren

@filamentphp also supported by you?

Profilbild von Ifeanyichukwu John
Ifeanyichukwu Johnvor 2 Jahren

Well done @calebporzio

Profilbild von Amit Mandaviya🇮🇳 | Full Stack| React JS| Laravel
Amit Mandaviya🇮🇳 | Full Stack| React JS| Laravelvor 2 Jahren

@PovilasKorop That's literally what mostly we need when we have long forms.

Profilbild von Vincent Uche
Vincent Uchevor 2 Jahren

Cool. What about a smooth scroll?

Profilbild von Caleb Porzio
Caleb Porziovor 2 Jahren

Pretty easy to add!

Ähnliche Videos