正在加载视频...

视频加载失败

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

42,746 次观看 • 2 年前 •via X (Twitter)

11 条评论

Logan Craft 的头像
Logan Craft2 年前

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…

Caleb Porzio 的头像
Caleb Porzio2 年前

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

Tuginho 的头像
Tuginho2 年前

Great for UX!

Swan Company Inc 的头像
Swan Company Inc2 年前

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.

𝕽𝖎𝖉𝖜𝖆𝖓𝖚𝖑𝖑𝖆𝖍🥰 的头像
𝕽𝖎𝖉𝖜𝖆𝖓𝖚𝖑𝖑𝖆𝖍🥰2 年前

Cool stuff, Caleb🥰

Ryan Bilesky 的头像
Ryan Bilesky2 年前

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.

Λlex Wulf 的头像
Λlex Wulf2 年前

@filamentphp also supported by you?

Ifeanyichukwu John 的头像
Ifeanyichukwu John2 年前

Well done @calebporzio

Amit Mandaviya🇮🇳 | Full Stack| React JS| Laravel 的头像
Amit Mandaviya🇮🇳 | Full Stack| React JS| Laravel2 年前

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

Vincent Uche 的头像
Vincent Uche2 年前

Cool. What about a smooth scroll?

Caleb Porzio 的头像
Caleb Porzio2 年前

Pretty easy to add!

相关视频