Skip to content

Cannot read property 'trim' of undefined #46

@NenadObradovic

Description

@NenadObradovic

Hello guys,

After updating the WooCommerce plugin to the latest version 5.4.0 - the select2 script stop working.

Main shop page - on dropdown click, I got - Cannot read property 'trim' of undefined

https://imgur.com/DlFV0A8
https://imgur.com/dfbDqrL

JS code which we use

this.holder = [];
this.holder.push(
	{
		holder: $( '.woocommerce-ordering select' ),
		options: {
			minimumResultsForSearch: Infinity
		}
	}
);

if ( typeof this.holder === 'object' ) {
	$.each(
		this.holder,
		function ( key, value ) {

			if ( typeof value.holder.select2 === 'function' ) {
				value.holder.select2( value.options );
			}
		}
	);
}

Best regards,
Nenad

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions