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

JS An invalid form control with name='input_name' is not focusable. #3209

Closed
adrhem opened this issue May 17, 2018 · 12 comments
Closed

JS An invalid form control with name='input_name' is not focusable. #3209

adrhem opened this issue May 17, 2018 · 12 comments

Comments

@adrhem
Copy link

adrhem commented May 17, 2018

  • Laravel Version: 5.6.2
  • Voyager Version: 1.1.1

Description:

When I use a field Rich Text Box in the BREAD I can't submit the form because I get the following error on Javascript Console.
An invalid form control with name='input_name' is not focusable.

It works if I fill the hidden input with Inspector Tool or with an script.

Steps To Reproduce:

  1. Add Rich Text Box as Field in BREAD
  2. Submit even if the field is not empty
@emptynick
Copy link
Collaborator

This bug should be fixed since 1.0.16.
Did you recently upgrade?
If so, please republish Voyagers assets (with force-flag) and try again.

@adrhem
Copy link
Author

adrhem commented May 17, 2018

I started the project this week. I'm using Translatable trait on that model if it helps. So I republished the Voyager assets and I get the same error

An invalid form control with name='name_input' is not focusable.

@vaggelis2018
Copy link

Same here.

@vaggelis2018
Copy link

Quick workaround is to add novalidate to the form

@farismohammed
Copy link

same problem
An invalid form control with name='body' is not focusable.
when using validation in posts

@jannejava
Copy link
Contributor

Don't know if I am late to the party. Unfortunately, I have the same problem. The latest version, freshly published assets. Seems to happen in Chrome when TinyMCE that is required, since TinyMCE is hiding the original textarea.

The bug seems to exists.
tinymce/tinymce#2584.

Which workaround has been tried?

@fletch3555
Copy link
Collaborator

I don't believe any workarounds have been tried yet. We're open to pull requests though

@emptynick
Copy link
Collaborator

Can't we just remove the required prop?
We dont really need the browser to validate the form, we do it anyway.

@ivanmart
Copy link

to remove the required prop you need either to override the default view or make field NULLable in database, plus change required setting in the data_rows table

@emptynick
Copy link
Collaborator

I know. I mean as a "final" solution, as Voyager does not need the required prop at all.

@alizadehmammadali
Copy link

Just add document.getElementById("richtextbody").required = false; to the end of edit-add.blade.php script tag and problem solved 👍
Here is my edit-add.blade.php file

@section('javascript')
    <script>
        $('document').ready(function () {
            $('#slug').slugify();

        @if ($isModelTranslatable)
            $('.side-body').multilingual({"editing": true});
        @endif
        });
        document.getElementById("richtextbody").required = false;
    </script>
@stop

@github-actions
Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants