Skip to content
Snippets Groups Projects
Commit 1a62e3c6 authored by Angie Byron's avatar Angie Byron
Browse files

Issue #2488884 by pixelmord, tim.plunkett, droplet: Machine name HTML5...

Issue #2488884 by pixelmord, tim.plunkett, droplet: Machine name HTML5 validation fails when field is hidden
parent 4ec324ef
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -34,8 +34,7 @@
function clickEditHandler(e) {
var data = e.data;
e.preventDefault();
data.$wrapper.show();
data.$wrapper.removeClass('visually-hidden');
data.$target.trigger('focus');
data.$suffix.hide();
data.$source.off('.machineName');
......@@ -94,7 +93,7 @@
// Figure out the maximum length for the machine name.
options.maxlength = $target.attr('maxlength');
// Hide the form item container of the machine name form element.
$wrapper.hide();
$wrapper.addClass('visually-hidden');
// Determine the initial machine name value. Unless the machine name form
// element is disabled or not empty, the initial default value is based on
// the human-readable form element value.
......@@ -137,6 +136,10 @@
// Initialize machine name preview.
.trigger('keyup');
}
// Add a listener for an invalid event on the machine name input
// to show its container and focus it.
$target.on('invalid', eventData, clickEditHandler);
});
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment