Comments (14)
Also, I cannot change .trigger('hidden')
to .trigger('hidden.modal')
in bootstrap-modal.js:207; the backdrop is no longer removed. I cannot find anywhere where hidden
is subscribed to and the backdrop is then removed.
from bootstrap-modal.
If you namespace the events with event.namespace
it will break everywhere that is just listening for the event. You will need to namespace all the listeners as well. The ModalManager
class is where the show/hidden events are subscribed to.
I believe this line bootstrap-modalmanager.js:64 would have to be something like .on('show.modal.modalmanager')
and the same goes for every other namespaced event.
I'm curious as I am also using the datepicker in my project and have had no issues, what event clashing are you experiencing?
Bootstrap will be namespacing all their events in an upcoming release so I plan to do the same when it is.
from bootstrap-modal.
Ah, if you have other components inside the modal which fire hide/show events you will see your event subscriptions on the modal being fired for them as well. This is why I'm anxiously waiting for them to namespace events.
I put in a work around to make sure that the ModalManager
class to make sure it would only fire the subscription if the modal was the one who fired it (see bootstrap-modalmanager.js:376). If I didn't do this, tabs within modals would cause the modalmanager to fire when you click a tab.
As for the focus issue, not sure if it's related or not but if you're able to create a jsfiddle demonstrating it I'd be glad to take a look.
from bootstrap-modal.
Ah ok.
#60; the issue my colleage has logged about the focus being lost in the modal.
from bootstrap-modal.
@jschr Shit, I accidentally deleted my comment between your last two. Have you still got it in your emails or anything?
from bootstrap-modal.
Ah ok.
Well, I was working with the modal's hide event, cleaning up some stuff. At one stage I noticed some unexpected behaviour so I just stuck in an alert() to be fired whenver the event was triggered, and it was being triggered way too much. It almost seemed like it was on every click.
Side note: We did also have a focus problem in the modal though, where complete() seemed to be called on the first click of the modal, not when the transition ended (see bootstrap-modalmanager.js:96). Therefore, if you clicked a field for example, it would gain but then lose focus. I'll get my colleague to log an issue on it (and I'll link it here) because he was the one actually troubleshooting it. It could be related, but I did still had the problem when I namespaced all the events in bootstrap-datepicker and this project, minus show.
Cool, I can do it when I've time if you like since I want to contribute anyway, and it can be merged in when Bootstrap namespaces theirs.>
from bootstrap-modal.
I don't know how to properly link an existing pull request to an existing issue so here's the pull request related to this issue.
from bootstrap-modal.
Closing for now as we now have a pull request but will wait for bootstrap to release their fix before merging.
from bootstrap-modal.
Is there a work around for this in the mean time? After adding bootstrap-modal we are no longer receiving shown
events (probably others) on modals, so this sort of code no longer works:
$(document).on 'shown', '.modal', ()->
$(this).find('.focus').focus()
I assume this is a related issue, but let me know if not. Thanks!
from bootstrap-modal.
Hmm, surprisingly...this works though:
$('.modal').on 'shown', ->
$(this).find('.focus').focus()
It has different functionality, so we really want to use the previous version - any idea why the snippet in my previous comment would have stopped working but this one works? Thanks!
from bootstrap-modal.
I think this is because I am using triggerHandler instead of trigger to fire the events. This is something that I need to change. It was a poor solution to solve some of the event namespacing issues that has been around since the first version. In the meantime you can make this change yourself in both the ModalManager and Modal classes to fix it. I will be pushing a fix for this as soon as I get some time.
from bootstrap-modal.
Thanks @jschr that worked perfectly actually (just did a global find/replace of triggerHandler
to trigger
). Seems like a pretty simple fix - shall I send a pull request?
from bootstrap-modal.
Ya sure that would be appreciated.
Thanks
from bootstrap-modal.
Done!
#69
On Fri, Feb 8, 2013 at 5:22 AM, Jordan Schroter [email protected]:
Ya sure that would be appreciated.
Thanks
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/57#issuecomment-13289922.
from bootstrap-modal.
Related Issues (20)
- is there any compatibility issues with select2.js? HOT 1
- Construct ajax query (ie. ajax Contact form)
- can i use this without bootstrap HOT 1
- angular 1.2.* ng-include used inside ui-bootstrap - modal opening page scrolls to top
- Show Modal Without overlay.
- Modal opens with a delay compared to standard BS3 modal
- Use modal with form validation
- body class="modal-open" style="padding-right: 15px" HOT 1
- Modal don't scroll when closing top modal
- The bootstrap dependency is different between github repo and bower repo.
- make collapsable?
- event.relatedTarget()
- How to relocate modal inside into a div
- Publish as NPM package
- Incompatible with Boostrap 4? HOT 4
- when using this with bootbox.js ,the bootbox dialog style was confused HOT 9
- Stackable: Close modal when clicked outside
- Will you upgrade to Bootstrap 4? HOT 1
- event listener for complete loading
- Replaced # with javascript:; in this statement and it worked.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bootstrap-modal.