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 'defaultView' of undefined #53

Open
MarzV opened this issue Jan 13, 2018 · 1 comment
Open

Cannot read property 'defaultView' of undefined #53

MarzV opened this issue Jan 13, 2018 · 1 comment

Comments

@MarzV
Copy link

MarzV commented Jan 13, 2018

Hello, I get this error in the console when I open a select that is styles true JCF plugin

Cannot read property 'defaultView' of undefined

when I use the wrapper on the native selects. These are my JS settings:

// initialize custom form elements
function initCustomForms() {
jcf.setOptions('Select', {
maxVisibleItems: 8,
wrapNative: false,
wrapNativeOnMobile: false,
fakeDropInBody:false,
});

var app = $('#app');
jcf.replaceAll(app);

}

The error is generated from this piece of script in Jquery:

var getStyles = function( elem ) {

	// Support: IE <=11 only, Firefox <=30 (#15098, #14150)
	// IE throws on elements created in popups
	// FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
	var view = elem.ownerDocument.defaultView;

	if ( !view || !view.opener ) {
		view = window;
	}

	return view.getComputedStyle( elem );
}

Console debuggers shows that the elem argument is undefined.

Could you please help me to find where this bug is comming from. For your information, your plugin is used as part of the code you provided in a project via psd2html service. It is used in a laravel framework. Please let me know if you need extra info..

Tnkz for your time

@yazonnile
Copy link
Collaborator

Hi, @MarzV
Could you provide some minimal jsfiddle example with such an error?

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

2 participants