We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
So in my code on axios...catch() I run:
axios...catch()
this.$setLaravelValidationErrorsFromResponse({errors: error.response.data});
then I try to find the first element with error:
let firstInputWithErrors = document.querySelector('input.is-danger');
I do this because my inputs are in tabs and I want to open first tab in which validation failed.
However firstInputWithErrors is null unless i put it in a setTimeout() wrapper.
firstInputWithErrors
null
setTimeout()
So to fix it I have:
setTimeout(() => { let firstInputWithErrors = document.querySelector('input.is-danger'); //..do rest of my logic }, 100);
Is there a nicer way to handle this?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
So in my code on
axios...catch()
I run:this.$setLaravelValidationErrorsFromResponse({errors: error.response.data});
then I try to find the first element with error:
let firstInputWithErrors = document.querySelector('input.is-danger');
I do this because my inputs are in tabs and I want to open first tab in which validation failed.
However
firstInputWithErrors
isnull
unless i put it in asetTimeout()
wrapper.So to fix it I have:
Is there a nicer way to handle this?
The text was updated successfully, but these errors were encountered: