-
-
Notifications
You must be signed in to change notification settings - Fork 79k
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
Modals return focus to [data-target="modal"] on hidden #13612
Conversation
Sorry for opening an incomplete PR, but I am spending way too much time trying to write the unit test and feel like it might be fixed easily with a little help. I have tried many times to get the test to pass, but the event doesn't seem to fine in Quint, but when I test in my browser it works as expected, so I am confused here. |
|
||
var triggered | ||
var div = $('<div id="modal-test"><div class="contents"></div></div>') | ||
var button = $('<a href="#mdoal-test" data-toggle="modal"></a>') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: "mdoal"
Your problem might be related to ariya/phantomjs#10427 . |
@@ -1076,6 +1076,8 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re | |||
Plugin.call($target, option, this) | |||
$target.one('hide', function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this take care of it anyways, wouldn't changing it form .one()
to .on()
take care of the issue?
Resolves issue twbs#12364 - small change in the data api to trigger focus on lauch element - attempt to write a test (HELP Needed!)
For the life of me I cannot get this to pass even in the browser. I am suspect that the events don't fire due to qunit-fixture div not being visible. Anyways, any help would be great! |
Quasi-duplicate of #4257. |
So, essentially, we seem to already have code that's supposed to do this, it just seems to be broken somehow. |
Superseded by #13627. Thanks for giving me a reason to look more closely at the existing code though. |
Glad this guy is closed. Felt unmotivated with the tests |
Resolves issue #12364