Skip to content
This repository was archived by the owner on Oct 20, 2025. It is now read-only.

Commit db12cb3

Browse files
committed
Added 'scrollToError' form prop
1 parent 8b645d2 commit db12cb3

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

resources/views/form.blade.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
<SpladeForm {{ $attributes->except('class') }}
44
@if($data['data']) :default="@js($data['data'])" @else :default="{!! $data['json'] !!}" @endif
5+
:scroll-on-error="@js($scrollOnError)"
56
:splade-id="@js($spladeId)"
67
>
78
<template #default="{!! $scope !!}">

src/Components/Form.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,12 @@ class Form extends Component
4444
*
4545
* @return void
4646
*/
47-
public function __construct($default = null, public string $scope = 'form', $unguarded = null)
48-
{
47+
public function __construct(
48+
$default = null,
49+
public string $scope = 'form',
50+
$unguarded = null,
51+
public bool $scrollOnError = true
52+
) {
4953
// We'll use this instance in the static 'selected()' method,
5054
// which is a workaround for a Vue bug. Later, when the
5155
// Form Data is resolved, we remove it from the array.

0 commit comments

Comments
 (0)