WebHare community

Form failed input scroll

Is there an easy way to prevent forms from scrolling to the first failed field?

Eg the this._scrollIntoView(result.firstfailed); part?

A custom event named ‘dompack:scrollintoview’ is fired by _scrollIntoView - you should be able to intercept that - I think addEventListener("dompack:scrollintoview", e=>e.preventDefault()); is the most brutal way to stop this. See also https://www.webhare.dev/reference/forms/javascript-handling about that event

Thank you, exactly what i needed.