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

How to add class dynamically (.e.g with @error directive)? #7

Open
vahnmarty opened this issue Feb 8, 2022 · 1 comment
Open

How to add class dynamically (.e.g with @error directive)? #7

vahnmarty opened this issue Feb 8, 2022 · 1 comment

Comments

@vahnmarty
Copy link

Using @error or $errors->has is not working on x-tel-input.

I used the error directive in both of the elements, the <p> works, but the x-tel-input is not working.

<x-tel-input
    id="phone-{{ $index }}"
    wire:model="phones.{{ $index }}.number"
    class="form-control {{ $errors->has('phones.'.$index.'.number') ? 'is-invalid' : 'is-valid' }}"
    phone-country-input="#phone_country_{{ $index }}"
/>/
<p>{{ $errors->has('phones.'.$index.'.number') ? 'is-invalid' : 'is-valid' }}</p>
@vahnmarty vahnmarty changed the title How to add class dynamically (Using @error directive)? How to add class dynamically (.e.g with @error directive)? Feb 8, 2022
@evokelektrique
Copy link

evokelektrique commented Jun 7, 2024

I don't think you can, because the input container is wrapped with a wire:ignore=""

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