Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'trim' of undefined #46

Open
NenadObradovic opened this issue Jun 9, 2021 · 0 comments
Open

Cannot read property 'trim' of undefined #46

NenadObradovic opened this issue Jun 9, 2021 · 0 comments

Comments

@NenadObradovic
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant