bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Modal 'shown' event breaks when class 'in' is added

Open aranm opened this issue 13 years ago • 10 comments

As per this fiddle: http://jsfiddle.net/aranm/J2aAk/1/

The modal is shown immediately and the shown event is not fired. If the modal's cancel button is hit the shown event will fire. The second time the modal is opened the shown event fires immediately.

If the 'in' class is removed behaviour works as expected, example here :http://jsfiddle.net/aranm/Pm4vL/1/

aranm avatar Apr 19 '13 03:04 aranm

I am getting the same problem and the same workaround (thanks for that). Not sure what the "in" class does, we probably just copied that from some example.

puw avatar May 06 '13 17:05 puw

The "in" class makes the modal slide in from the top of the screen. I'd like to be able to use it.

aranm avatar May 06 '13 23:05 aranm

Unable to vote for this issue, so I'll post here. I have the same behaviour with in class as well. And workaround is to remove in class.

geaden avatar May 20 '13 12:05 geaden

Not sure if this is relevant or not, but you can make it fire by hovering the mouse over a .btn class object. However, it doesn't help as there's no practical programmatic access to do that. Removing in does fix it however.

AlexCrookes avatar May 31 '13 18:05 AlexCrookes

Interesting. I'm not getting 'show' event triggered even when removed 'in' class - but I find it keeps added dynamically when show is JS-triggered (which isn't supposed to happen in this case)? Same with 'hidden', 'hide' events.

ux-engineer avatar Jun 29 '13 15:06 ux-engineer

don't put in on it? how is this an issue…

fat avatar Jul 18 '13 04:07 fat

@fat without the 'in' class the modal does not slide into view. It just appears immediately. I would like the modal to slide in from the top of the screen. It is the intended behaviour, it was put there for a reason. This is an issue.

aranm avatar Jul 18 '13 05:07 aranm

@fat If this is not reopened I guess I will just have to recreate the issue in a new one. This is an issue for a number of people, has never been addressed and has been closed previously (in another issue). I'm quite annoyed that without understanding the problem, this is just treated as irrelevant and closed.

aranm avatar Jul 18 '13 07:07 aranm

@fat There is definitely something broken here.

I'm having also another issue which could perhaps be related. That when the class "fade" is in a modal window, focus on input is blurred after the modal appears. If I remove that class, well - it doesn't fade. Perhaps I could make a custom transition class but that doesn't solve the problem - things aren't working as supposed. See here: https://github.com/twitter/bootstrap/issues/8107

ux-engineer avatar Jul 21 '13 11:07 ux-engineer

if you want it to slide in - call slide on the modal with js on page load

fat avatar Jul 24 '13 01:07 fat