Conversation
|
This is intentionall. ractive-modal shouldn't enforce any scroll locking behavior on the parent page, it's not good UX since some users might want to scroll to see what's behind the modal. Instead of hard-coding this behavior into ractive-modal what I think is the most appropriate solution is to hook on the beforeOpen and afterClose events and apply this behavior yourself. check here Line 469 in 49faed3 Line 472 in 49faed3 |
|
@ceremcem thank you for contributing and please also check the dev branch which introduces CSS animations for the modal and the backdrop. |
|
I have created a fix for this in dev 5cdf7c3 can you check if this works for you? |
|
This functionality is now implemented as a plugin . |
|
There are couple of problems with this "inheritance" approach:
Most important question is ProposalAt least, we should find a way to provide a simple switch, like |
|
Here is the working proposal: Playground // initialize with default settings
Ractive.components.modal = RactiveModal();
// or initialize with initialization options
Ractive.components.modal = RactiveModal({
"background-scroll": 'allow', // "allow" or "prevent"
featureX: false,
foo: 'bar'
});In the template, user is allowed to set it explicitly to override the default settings: <modal background-scroll="prevent" ...></modal> |
When a modal contains some complex objects that introduces scrolling, such as an image editor:
...underlying page (below modal) should not be scrolled while in the process of interaction. This commit adds a switch for that purpose:
Usage
Is breaking
No.