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

An invalid form control with name=’series_part[0]’ is not focusable #694

Closed
rizaardiyanto1412 opened this issue Nov 8, 2022 · 3 comments · Fixed by #713
Closed

An invalid form control with name=’series_part[0]’ is not focusable #694

rizaardiyanto1412 opened this issue Nov 8, 2022 · 3 comments · Fixed by #713

Comments

@rizaardiyanto1412
Copy link

When trying to save a post (in the Classic Editor), nothing happens, and the browser console shows this message

An invalid form control with name='series_part[0]' is not focusable.

<input class="small-text pp-series-part-input" min="1" type="number" name="series_part[0]" id="series_part" size="5" value="0" oninput="this.value = 
 !!this.value && Math.abs(this.value) >= 0 ? Math.abs(this.value) : null">

There’s no series linked to the post.

I’m on PHP 8.0, WordPress 6.0.3 and Series 2.10.0.

Looking at it again, I can see that the element series-part-wrap has an inline style display: none;, which hides the bottom part of the series sidebar widget, and makes its contents unfocusable.

If I manually disable this inline style, the box contains the number 0, and when trying to update the post, I get a validation error, saying the this isn’t a valid value for the field.

This is because of the attributes min="1" type="number" on the input field.

Posts with a series set can be updated, but posts without a series cannot.

Original thread: https://wordpress.org/support/topic/an-invalid-form-control-with-nameseries_part0-is-not-focusable/

@rizaardiyanto1412
Copy link
Author

After much investigation, I saw that orgSeries-admin.php sets the display of 3 elements to none based on plugin metabox settings, which are unchecked.

I don’t recall these settings from when I first configured the plugin. Are they new, and default to being unchecked?

But even when they are visible, I get a validation error when the series part is set to 0.

If I delete the 0, I can save the post, but then, the 0 comes back, along with the inability to save.

This seems to have been caused recently by this change: “Fixed: Only allow valid numbers in series part input #634”.

@galbaras
Copy link

galbaras commented Nov 9, 2022

Since 0 is a valid value, changing to min="0" should fix the validation issue.

@olatechpro
Copy link
Collaborator

Thanks @galbaras for the full details

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