Skip to content

Setting dragToClose=false after the instance is already initialized does not take effect #852

@sunwayru

Description

@sunwayru

Describe the bug

Hello! It seems there is an issue with dynamic option updates.
Setting Fancybox.getInstance().getOptions().dragToClose = false after the instance is already initialized does not take effect. Even if I modify the options object of an active instance, the dragging behavior persists.
It looks like the dragToClose event listeners are attached during the initial setup phase and are not re-evaluated or updated when the options object is modified at runtime.
Expected behavior:
The instance should reflect the changes made via getOptions() or provide an update() method to re-bind event listeners based on the new configuration. Or tell me how to turn it on dynamically.

Reproduction

Open a Fancybox instance.
Execute Fancybox.getInstance().getOptions().dragToClose = false; in the console.
Observe that the gallery can still be closed by dragging.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageThis issue has not been triaged by maintainers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions