Bug: Banner "Connect Jetpack to activate WooCommerce Shipping & Tax" is submitted instead of settings when pressing enter key on WooCommerce settings page
Opened this issue · 0 comments
When visiting the settings page for WooCommerce, at URL like
http://example.com/wordpress/wp-admin/admin.php?page=wc-settings&tab=general
below the setting pages tabs and above subnav (the nav with .subsubsub
).
there is "nux banner" outputted (using show_nux_banner
).
When trying to submit the form with the settings for WooCommerce using the enter/return key, what actually happens is that the button on the nux banner is submitted, due to the fact that that button is the first button of the settings form.
My guess is that this is because that is the first button in the form according to
https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#implicit-submission
"A form element's default button is the first submit button in tree order whose form owner is that form element."
I have tried to debug this a little bit and what I can find is that the nux banner is shown for me because the function show_banner_before_connection()
is called because my jetpack_connection_status is JETPACK_ACTIVATED_NOT_CONNECTED
and this function is called in hook admin_notices
which is fired somewhere inside the form.
Attaching an awesome good looking screenshots so you know what banner I'm talking about