Ticket #4168 (closed bug: wontfix)

Opened 5 years ago

Last modified 15 months ago

Event name collision with mootools

Reported by: ntoniazzi Owned by:
Priority: major Milestone: 1.11.0
Component: ui.slider Version: 1.6rc6
Keywords: Cc:
Blocking: Blocked by:

Description

When integrating jquery+ui (in noConflict mode) with mootools (not a choice), both libraries answer to the "slide" event, and unfortunately, mootools shoots first.

  • Mootools: Fx.Slide, "slide" method
  • jQuery-ui: ui.slider, "slide" callback

Shouldn't namespaced events prevent this kind of collision? By adding 'ui' or 'jquery-ui' somewhere?

Change History

comment:1 Changed 5 years ago by rdworth

  • Milestone changed from 1.7 to 1.8

comment:2 Changed 5 years ago by kungfu71186

anyway to fix this?

comment:3 Changed 5 years ago by ntoniazzi

A workaround is to remove any previous "slide" method before calling the plugin :

jQuery('div.slider').removeAttr('slide').slider({...});

But it's only a workaround.

comment:4 Changed 4 years ago by amsys

confirming this problem, the workaround resolved the issue for me, thanks

comment:5 Changed 3 years ago by dostrog

Until ticket is opened, I've change name 'slide' in lib. Some details in my answer on stackoverflow:

http://stackoverflow.com/questions/4024102/jquery-ui-slider-moving-upwards-and-disappearing-in-the-div-when-used/6778076#6778076

It's work on my joomla 1.6 based site with mootools and jquery-ui enabled

comment:6 Changed 3 years ago by cameronbot

The workaround in commet 3 by ntoniazzi did not work for me, however I found this answer on stackoverflow with another workaround which worked:  http://stackoverflow.com/a/7697597

jQuery('div.slider')[0].slide = null;
jQuery('div.slider').slider({...});

comment:7 Changed 22 months ago by scott.gonzalez

  • Milestone changed from 1.9.0 to 1.11.0

comment:8 Changed 21 months ago by tj.vantoll

  • Status changed from new to open

We are planning on switching to firing "widget:event" (for example "slider.slide") to avoid naming collisions with native events.

In the meantime you can switch the prefix the slider plugin uses as a workaround -  http://jsfiddle.net/tj_vantoll/4uXbk/.

comment:9 Changed 15 months ago by scott.gonzalez

  • Status changed from open to closed
  • Resolution set to wontfix

I'm not sure what Mootools is doing, or if this is still a problem, but I'm guessing that this falls into the Object.prototype-ish bucket.

Note: See TracTickets for help on using tickets.