Skip to content
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

[BUG] issues and improvements for modal #29

Closed
thednp opened this issue Oct 31, 2015 · 13 comments
Closed

[BUG] issues and improvements for modal #29

thednp opened this issue Oct 31, 2015 · 13 comments

Comments

@thednp
Copy link
Owner

thednp commented Oct 31, 2015

Issues:

  • need to implement a better addClass / removeClass, as currently we are adding 10+ open-modal classes to the body
  • the body need a padding right/left when modal-open, just like the new version of the original plugin
  • also modal seems to have an overflow issue, we might need to rework the HTML structure
  • I'll try to rework this one Overlay disappears when starting a modal from another modal #30
@ghost
Copy link

ghost commented Nov 2, 2015

would you also be able to add similar support to bootstraps data-keyboard and data-backdrop http://getbootstrap.com/javascript/#modals-options ? Currently you can keep the modal visible if the user clicks outside of it but the backdrop disappears. Also it'd be nice to prevent the escape key from closing the modal but only for specific dialogs

@thednp
Copy link
Owner Author

thednp commented Nov 2, 2015

We already support those options. I also don't understand perfect what you mean.. are you using multiple opened modals at the same time?

@ghost
Copy link

ghost commented Nov 2, 2015

They don't really work, or I am doing something wrong. Here is a super simple testcase
Edit line 228 on the provided index.html file
https://github.com/thednp/bootstrap.native/blob/master/index.html#L228
Change it to be

Click the "Launch Simple Modal" button and then click escape. The modal stays but the backdrop disappears. I can reproduce this in both Chrome 46 and FireFox 38.

You can also mouse click outside of the modal and it will disappear

@ghost
Copy link

ghost commented Nov 2, 2015

Sorry HTML got stripped out
div id="myModal" class="modal fade" data-backdrop="static" data-keyboard="false" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"

is what you change it to

@thednp
Copy link
Owner Author

thednp commented Nov 2, 2015

If you change the data-backdrop or data-keyboard after Modal was initialized would produce no effect because the Modal object caches the options values once and no more. I should have shown a demo where they showcase these options I guess.

@ghost
Copy link

ghost commented Nov 2, 2015

Not sure I follow, I'm not changing the values after initializing, I'm just adding them to the example modal on the demo page. The keyboard one is partially taking effect because the modal stays but the backdrop disappears when pressing escape

@thednp
Copy link
Owner Author

thednp commented Nov 3, 2015

So you downloaded the demo, edited the index.html file with these options on the modal example and you spotted the issue? Please, what is your OS and browser?

@ghost
Copy link

ghost commented Nov 3, 2015

Correct I downloaded a zip from github, extracted the files to a new directory, made the one change to index.html on line 228 to add data-backdrop="static" and data-keyboard="false", saved, then opened index.html and clicked on launch simple modal. When I click outside of the modal it disappears which is not what data-backdrop="static" does for bootstrap. When I click escape on my keyboard the modal background disappears but the modal is left in place

I'm on windows 7 and can reproduce in Chrome 46 and FireFox 38

Are you not able to reproduce this problem?

@thednp
Copy link
Owner Author

thednp commented Nov 3, 2015

I don't have much time to test (I know if I start testing I usually start working on it and thus takes even more time), so I noted here a little to do for the next release. I also noted your report, so thank you, I will solve the issue asap.

@thednp
Copy link
Owner Author

thednp commented Dec 2, 2015

@osdlge I think your issue is a content related issue, I cannot reproduce the issue at all.

@ghost
Copy link

ghost commented Dec 2, 2015

So when you enable data-backdrop="static" and press the esc key on the modal the backdrop and modal stay in place? The only change I made was to the provided sample and adding data-backdrop="static" data-keyboard="false" tabindex="-1"

@thednp
Copy link
Owner Author

thednp commented Dec 2, 2015

Modal currently doesn't know what data-backdrop="static" is. Only the options and their values that you see in the demo. The data-backdrop attribute can only be true / false.

@thednp
Copy link
Owner Author

thednp commented Dec 3, 2015

Done the rework 7985fae

@thednp thednp closed this as completed Dec 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant