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' ) + '"]' ) .find( 'option[value="' + $( el ).data( 'taxonomy' ) + '"]' )
.attr( 'disabled', 'disabled' ); .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( $( 'select.wc-attribute-search' ).data(
'disabled-items', 'disabled-items',

View File

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