bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Issue in Twitter Bootstrap Model dialog component for IE10

Open cew6992 opened this issue 14 years ago • 2 comments

This relates to IE10 in Windows 8 and appears to be a regression from IE9.

Steps to Reproduce:

  1. Navigate to Navigate to http://twitter.github.com/bootstrap/javascript.html#modals
  2. Press the Launch demo modal button

Expected Result: See modal dialog Actual Result: Dialog outline appears but content is missing.

Developer Notes: It appears that twitter.com uses a feature detect, but they put the MS-prefixed name first, instead of last.

bootstrap-transition.js:35: var el = document.createElement('bootstrap') , transEndEventNames = { 'WebkitTransition' : 'webkitTransitionEnd' , 'MozTransition' : 'transitionend' , 'OTransition' : 'oTransitionEnd' , 'msTransition' : 'MSTransitionEnd' , 'transition' : 'transitionend' // <-------------------------- This should come first! } , name

    for (name in transEndEventNames){
      if (el.style[name] !== undefined) {
        return transEndEventNames[name]
      }
    }

This leads to jQuery using 'addEventListener("MSTransitionEnd", …)'

In the process of setting up the event handler, jQuery maintains an internal cache of event types that have been dispatched. After an event fires, it uses this cache to filter and do other tricks:

jquery.js:3174: // This is called right after the "transitionend" event is actually fired… I dispatch: function( event ) {

                            // Make a writable jQuery.Event from the native event object
                            event = jQuery.event.fix( event || window.event );

                            var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []),
                                            delegateCount = handlers.delegateCount,
                                            args = [].slice.call( arguments, 0 ),
                                            run_all = !event.exclusive && !event.namespace,
                                            handlerQueue = [],
                                            i, j, cur, jqcur, ret, selMatch, matched, matches, handleObj, sel, related;

The call to _data retrieves the internal cache. The code then indexes into that cache to find the event type using the event type returned from the actual event. Unfortunately, the event types don't match up (event.type returns "transitionend", but jQuery's internal data cache only has "MSTransitionEnd", and since the index fails with undefined, the empty array is used instead. As a result, the actual associated handler is never invoked

cew6992 avatar Aug 23 '12 16:08 cew6992

Dupe of #4637.

mdo avatar Aug 23 '12 16:08 mdo

Please Simplify did you solve modal window in ie 10 animation

maherelghali avatar Sep 27 '12 13:09 maherelghali