Ensure that a placeholder always exists

This commit is contained in:
Jason Kytros 2023-09-01 13:53:54 +03:00
parent 4aeabe64ef
commit 80e998481f
2 changed files with 6 additions and 2 deletions

View File

@ -463,6 +463,10 @@ jQuery( function ( $ ) {
.find( 'option[value="' + $( el ).data( 'taxonomy' ) + '"]' )
.attr( 'disabled', 'disabled' );
}
if ( 'undefined' === $(el).attr( 'data-taxonomy' ) || false === $(el).attr( 'data-taxonomy' ) || '' === $(el).attr( 'data-taxonomy' ) ) {
add_placeholder_to_attribute_values_field( $(el) );
}
} );
$( 'select.wc-attribute-search' ).data(
'disabled-items',

View File

@ -41,8 +41,8 @@ test.describe( 'Add product attributes', () => {
test( 'can add custom product attributes', async ( { page } ) => {
const textbox_attributeName =
page.getByPlaceholder( 'f.e. size or color' );
const textbox_attributeValues = page.getByLabel(
'Value(s):'
const textbox_attributeValues = page.getByPlaceholder(
'Enter options for customers to choose from'
);
const checkbox_visible = page
.getByText( 'Visible on the product page' )