-
-
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
Support configuring "root element" for modal #33018
Conversation
Hi @XhmikosR is there something I can do to help move this PR along? :) |
No, sorry, I'm a little busy with Real Life. Maybe @rohit2sharma95 or @GeoSot can help with review. For what is worth, I'm definitely in favor of the null tests change. |
@spicalous try to create a working optical example in (You may need to revert it later) |
550c63c
to
ea21df6
Compare
@XhmikosR I didn't mean to rush, thank you for your time and bringing relevant people to the discussion! @GeoSot I have added an example, please let me know what you think |
I would suggest you to open another Pr with the null changes on tests I am not sure if |
I have created #33288 separately for the tests changes In the mean time, i'm happy to either decline this or wait until someone can make the decision whether this feature should be added :) Thanks for your time everyone |
Spicalous Please remove them from here :) |
@spicalous I apologize for the delay. I had in mind this PR, and tried to make some steps, on backdrop, scrollbar and modal. Do you still want to close it? |
Thanks @GeoSot, happy to re-open. Only just saw the mention from #33665 now. I haven't looked at the changes, but I assume we'll be able to incorporate the solution into this PR? I'll have a look at understanding the changes and will update this branch accordingly Please let me know if this is what you had in mind or if there's something I should do / can help out with :) |
Scrollbar and backdrop functionality, have been decoupled to be used on offcanvas too, |
I think we are in the right moment to continue this MR. |
41519b7
to
120e344
Compare
@GeoSot Had another attempt with the latest master Notes
|
bring back .modal-open as we keep it for compatibility reasons
I 'll try to help you till there, and we will find a solution Plus:
|
@@ -1,4 +1,4 @@ | |||
import { Tooltip } from '../../../dist/js/bootstrap.esm.js' | |||
import { Tooltip } from './../../../dist/js/bootstrap.esm.js' |
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.
I had to add this, otherwise the tests was failing for me :/
Please, keep calm. I am here 😋 Do not mess with backdrop yet. I am trying to help merging #34149 Try to keep your changes to minimum |
@spicalous any update on this? |
e1eb294
to
0536f6c
Compare
js/src/util/scrollbar.js
Outdated
constructor() { | ||
this._element = document.body | ||
constructor(rootElement) { | ||
this._element = rootElement || document.body |
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.
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.
I'm not sure how I could add a test in modal (I see in the MR that we are asserting spied methods of ScrollBarHelper
. Please let me know if you had something in mind. In the mean time, I have added a test for ScrollBarHelper
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.
@spicalous
I tried to fix it a bit and added the tests and functionality for scrollbar.
I am not very sure about scrollbar modifications, so you better take a second look
Nice job till here 👍 Getting closer tip: check the preview. modal.js:l89 misses the proper initialization |
- resolve rootElement using getElement() when creating config; - reinstate modal-open class - refactor boolean flag to method
c17aae6
to
9d1c7b3
Compare
I found out a 'bug' if you try to put some content inside the empty root element, it will over-float. Till here we are fine. |
I am closing this as stale. |
Hi guys,
New contributor here, please let me know if I have missed anything
This PR attempts to resolve #31509 adding support to allow configuring the "root element" for the modal component. This PR only implements configuring this when initialising the modal via Javascript. I haven't dug deep into how this can be done via providing html attributes.
Please let me know if this is the right approach
Thanks!
preview
closes #34309