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

Unexpected behavior using real-time livewire validation #23

Open
isma1206 opened this issue Dec 20, 2020 · 1 comment
Open

Unexpected behavior using real-time livewire validation #23

isma1206 opened this issue Dec 20, 2020 · 1 comment

Comments

@isma1206
Copy link

Hi.
When I tried to use the livewire function to make a real-time validation:

public function updated($propertyName)
    {
        $this->validateOnly($propertyName);
    }

The errors doesn't work like I expected because only show one error at time if 2 or more fields has errors they just disappear and form only show the current field error. I think because every time one of my models is updated the model "honeyInputs.honey_javascript" is updated to, and the livewire function only expect one property.

I made it work as expect adding this conditional on the function:

public function updated($propertyName)
    {
        if ($propertyName !='honeyInputs.honey_javascript'){
            $this->validateOnly($propertyName);
        }
    }

Maybe you could make something in the future to avoid use this conditional

Thanks for your work your package is very helpful.

@lukeraymonddowning
Copy link
Owner

Sorry for the delay on this. I'm currently focused on #22, but this is next up.

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

2 participants