Skip to content

Tooltip show / hide error #2148

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

Closed
ferpagano opened this issue Jan 9, 2023 · 2 comments
Closed

Tooltip show / hide error #2148

ferpagano opened this issue Jan 9, 2023 · 2 comments

Comments

@ferpagano
Copy link

Hello,

I'm using pgGrid (v8.7,0) with column validation inside an Angular v13(13.3.12) App. When the validator fires It should show the tooltip but It's throwing a TypeError. The line that has the problem is:
"options.complete = callback;"
The variable "options" is a boolean, and I think problem is related to strict mode because when I tried a similar line without strict mode, it ran fine.

jquery -> v3.4.0
jquery-ui-pack -> v1.12.3

Thanks in advance.
Fernando.

TypeError: Cannot create property 'complete' on boolean 'true'
Error:
core.mjs:7739
ERROR TypeError: Cannot create property 'complete' on boolean 'true'
at $.Widget. [as _show] (jquery-ui.js:716:3)
at $..._open (jquery-ui.js:15926:8)
at $..._open (jquery-ui.js:139:25)
at $..._updateContent (jquery-ui.js:15855:9)
at $..._updateContent (jquery-ui.js:139:25)
at Object. (jquery-ui.js:15732:10)
at Function.each (jquery.js:391:19)
at $..._setOption (jquery-ui.js:15731:6)
at $..._setOption (jquery-ui.js:139:25)
at $..._setOptions (jquery-ui.js:429:9)

jquery-ui.js CODE:
`
$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
$.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
if ( typeof options === "string" ) {
options = { effect: options };
}

	var hasOptions;
	var effectName = !options ?
		method :
		options === true || typeof options === "number" ?
			defaultEffect :
			options.effect || defaultEffect;

	options = options || {};
	if ( typeof options === "number" ) {
		options = { duration: options };
	}

	hasOptions = !$.isEmptyObject( options );
	options.complete = callback;

	if ( options.delay ) {
		element.delay( options.delay );
	}

	if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
		element[ method ]( options );
	} else if ( effectName !== method && element[ effectName ] ) {
		element[ effectName ]( options.duration, options.easing, callback );
	} else {
		element.queue( function( next ) {
			$( this )[ method ]();
			if ( callback ) {
				callback.call( element[ 0 ] );
			}
			next();
		} );
	}
};

} );

`

@mgol
Copy link
Member

mgol commented Jan 11, 2023

Thanks for the report. This has been fixed in #1931 and is present in jQuery UI 1.13.0 or newer. jQuery UI 1.13 always runs in strict mode.

Please always update to the latest stable version of jQuery UI before submitting an issue. A confusion here might be that the jquery-ui-pack package doesn't have any newer version. This package is not maintained by us, though, and it looks unmaintained at the moment. You'll need to switch to the upstream one. Note that it's not exported as a CommonJS module, though.

I'd be fine with adding such a support - PRs welcome if you're interested. It'd most likely need to land in 1.14.0 as it may be breaking in some edge cases.

@mgol mgol closed this as not planned Won't fix, can't repro, duplicate, stale Jan 11, 2023
@ferpagano
Copy link
Author

Thanks!. Didn't notice jquery-ui-pack was from a different project.

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

No branches or pull requests

2 participants