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

Uncaught Error: Method value does not exist on jQuery.tooltip #2821

Closed
bfintal opened this Issue Feb 20, 2016 · 9 comments

Comments

Projects
None yet
7 participants
@bfintal

bfintal commented Feb 20, 2016

Hi, I encountered an error regarding $.fn.slider in materialize.js and WordPress Core's color picker:

Here's the JS error for reference:

Uncaught Error: Method value does not exist on jQuery.tooltip

stemmed from the $.error in these lines:

$.fn.slider = function(methodOrOptions) {
  if ( methods[methodOrOptions] ) {
    return methods[ methodOrOptions ].apply( this, Array.prototype.slice.call( arguments, 1 ));
  } else if ( typeof methodOrOptions === 'object' || ! methodOrOptions ) {
    // Default to "init"
    return methods.init.apply( this, arguments );
  } else {
    $.error( 'Method ' +  methodOrOptions + ' does not exist on jQuery.tooltip' );
  }
}; // Plugin end

Edit: Dug through WP's code, the error occurs when WP's Iris color picker calls:

controls.stripSlider.slider( 'value', value );

stripSlider though is created using jQuery-UI. So I think the conflict is from Materialcss & jQuery-UI.

Would it be possible to namespace Materialcss's slider function?

@desaintmartin

This comment has been minimized.

Show comment
Hide comment
@desaintmartin

desaintmartin Sep 15, 2016

I can confirm using Materialize and jQuery-UI (not Wordpress). Calling $('.myslider').slider("value"); results in this exception.

desaintmartin commented Sep 15, 2016

I can confirm using Materialize and jQuery-UI (not Wordpress). Calling $('.myslider').slider("value"); results in this exception.

@mehmetalidumlu

This comment has been minimized.

Show comment
Hide comment
@mehmetalidumlu

mehmetalidumlu Sep 19, 2016

I have same problem :/
Has anybody solved it?

mehmetalidumlu commented Sep 19, 2016

I have same problem :/
Has anybody solved it?

@fega

This comment has been minimized.

Show comment
Hide comment
@fega

fega Apr 10, 2017

@bfintal @desaintmartin @mehmetalidumlu
Could someone check if this is still an issue with the latest version?, also, please provide a codepen to reproduce the issue

Closed due inactivity, feel free to reopen it if it is still necessary.

fega commented Apr 10, 2017

@bfintal @desaintmartin @mehmetalidumlu
Could someone check if this is still an issue with the latest version?, also, please provide a codepen to reproduce the issue

Closed due inactivity, feel free to reopen it if it is still necessary.

@fega fega closed this Apr 10, 2017

@qantumthemes

This comment has been minimized.

Show comment
Hide comment
@qantumthemes

qantumthemes Jun 19, 2017

Hello!

Still an issue on latest version, just try to call any method of slider requiring arguments and will reproduce the issue, no need to spend 15 minutes for a codepen ;)
Just try
$(".YourSlider").slider('sliderTo',1);

Next and prev doesn't give errors, only when a second argument is passed you'll see the "tooltip" error popping.
The slider works as usual until you try skipping to a slide (for a custom index for example).

My code


$('.qt-material-slider').each(function(i,c){
			var that = $(c);
			
			that.find(".prev").click(function(){
				that.slider("prev");
			});
			that.find(".next").click(function(){
				that.slider("next");
			});
			
			that.find("[data-qtslidegoto]").click(function(e){
				e.preventDefault();
				var togo = $(this).attr("data-qtslidegoto");
				//that.slider("prev");
				console.log(togo);
				//that.moveToSlide(togo);
				that.slider('sliderTo',togo);
				 //
				// console.log( that.slider);
			});

		});

Error code (line 710 is the one quoted above)

Uncaught Error: Method sliderTo does not exist on jQuery.tooltip
at Function.error (jquery.js:2)
at a.fn.init.a.fn.slider (materialize.min.js:9)
at HTMLAnchorElement. (qt-main.js:710)
at HTMLAnchorElement.dispatch (jquery.js:3)
at HTMLAnchorElement.r.handle (jquery.js:3)

qantumthemes commented Jun 19, 2017

Hello!

Still an issue on latest version, just try to call any method of slider requiring arguments and will reproduce the issue, no need to spend 15 minutes for a codepen ;)
Just try
$(".YourSlider").slider('sliderTo',1);

Next and prev doesn't give errors, only when a second argument is passed you'll see the "tooltip" error popping.
The slider works as usual until you try skipping to a slide (for a custom index for example).

My code


$('.qt-material-slider').each(function(i,c){
			var that = $(c);
			
			that.find(".prev").click(function(){
				that.slider("prev");
			});
			that.find(".next").click(function(){
				that.slider("next");
			});
			
			that.find("[data-qtslidegoto]").click(function(e){
				e.preventDefault();
				var togo = $(this).attr("data-qtslidegoto");
				//that.slider("prev");
				console.log(togo);
				//that.moveToSlide(togo);
				that.slider('sliderTo',togo);
				 //
				// console.log( that.slider);
			});

		});

Error code (line 710 is the one quoted above)

Uncaught Error: Method sliderTo does not exist on jQuery.tooltip
at Function.error (jquery.js:2)
at a.fn.init.a.fn.slider (materialize.min.js:9)
at HTMLAnchorElement. (qt-main.js:710)
at HTMLAnchorElement.dispatch (jquery.js:3)
at HTMLAnchorElement.r.handle (jquery.js:3)

@qantumthemes

This comment has been minimized.

Show comment
Hide comment
@qantumthemes

qantumthemes Jun 19, 2017

update, jQuery tooltip has nothing to do, is a wrong message on slider.js line 321

$.error( 'Method ' + methodOrOptions + ' does not exist on jQuery.tooltip' );

I think maybe the method moveToSlide is not public? (i'm not so good to fix this, sorry)

qantumthemes commented Jun 19, 2017

update, jQuery tooltip has nothing to do, is a wrong message on slider.js line 321

$.error( 'Method ' + methodOrOptions + ' does not exist on jQuery.tooltip' );

I think maybe the method moveToSlide is not public? (i'm not so good to fix this, sorry)

@frmsaul

This comment has been minimized.

Show comment
Hide comment
@frmsaul

frmsaul Feb 16, 2018

This is still broken :(

Whats the standard workaround for this problem?

frmsaul commented Feb 16, 2018

This is still broken :(

Whats the standard workaround for this problem?

@fega

This comment has been minimized.

Show comment
Hide comment
@fega

fega Feb 17, 2018

@Dogfalo maybe is a good idea reopen this?

fega commented Feb 17, 2018

@Dogfalo maybe is a good idea reopen this?

@Dogfalo

This comment has been minimized.

Show comment
Hide comment
@Dogfalo

Dogfalo Feb 18, 2018

Owner

MoveToSlide and sliderTo are not slider supported methods. These are the supported methods:

// Pause slider
$('.slider').slider('pause');
// Start slider
$('.slider').slider('start');
// Next slide
$('.slider').slider('next');
// Previous slide
$('.slider').slider('prev');
Owner

Dogfalo commented Feb 18, 2018

MoveToSlide and sliderTo are not slider supported methods. These are the supported methods:

// Pause slider
$('.slider').slider('pause');
// Start slider
$('.slider').slider('start');
// Next slide
$('.slider').slider('next');
// Previous slide
$('.slider').slider('prev');
@frmsaul

This comment has been minimized.

Show comment
Hide comment
@frmsaul

frmsaul Feb 20, 2018

@Dogfalo
How should one access the current value of the slider?
Which method supports that functionality?

frmsaul commented Feb 20, 2018

@Dogfalo
How should one access the current value of the slider?
Which method supports that functionality?

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