Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

preConfirm value #131

Open
bucari opened this issue Oct 20, 2023 · 5 comments
Open

preConfirm value #131

bucari opened this issue Oct 20, 2023 · 5 comments

Comments

@bucari
Copy link

bucari commented Oct 20, 2023

Hi, after updating to livewire-alert 3, value in preConfirm is not anymore in $data passed to onConfirm function

            $this->confirm('Rifiutare il documento n° '. $id . '?', [ 
                'inputAttributes' => ['id' => $id],
                'onConfirmed' => 'rejectConfirmed',
                'focusConfirm'=> false,
                'input' => 'text',
                'inputLabel' => 'Motivo del rifiuto',
                'preConfirm' => '(value) => {'.
                    'if (!value) {'.
                    ' Swal.showValidationMessage('.
                    "   '<i class=\"fa fa-info-circle\"></i> Indicare il motivo di rifiuto'".
                    ' )'.
                    '}'.
                  '}'
            ]);

then in

    #[On('rejectConfirmed')]
    public function rejectConfirmed($data)

$data contains only inputAttributes array

@sontungx305
Copy link

Have you been able to solve it yet? I have the same problem.

@bucari
Copy link
Author

bucari commented Nov 9, 2023

Unfortunately not

@sontungx305
Copy link

sontungx305 commented Nov 9, 2023

I found the solution.

Try adding $value param to rejectConfirmed function.

public function rejectConfirmed($data, $value)

@bucari
Copy link
Author

bucari commented Nov 10, 2023

Thank you, i will try

@ezehkingsleyuchenna
Copy link

I found the solution.

Try adding $value param to rejectConfirmed function.

public function rejectConfirmed($data, $value)

This worked for me.
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants