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

Breakpoint configuration for "mouseDrag"/"touchDrag" properties is not applied. #211

Open
Lawrence-M-Reynolds opened this issue May 3, 2021 · 0 comments

Comments

@Lawrence-M-Reynolds
Copy link

The case we had was to be able to apply the "mouseDrag" and "touchDrag" configuration settings based on the number of slides displayed. This depends on the breakpoint state but it appears that those configuration settings are only processed once - when the initEvents function is fired (via the mounted() function). This will attach the event listener's if the settings are enabled. For example:

if (this.config.mouseDrag) { this.$refs.list.addEventListener('mousedown', this.onDragStart); }

Although these two configuration settings are updated when the break point state is checked (via the updateConfig function) the state of the event listeners is not modified at all. So the breakpoint configurations for these settings did not change the behaviour of the carousel.


A workaround for this was to enable both settings regardless of the breakpoint state. A new custom property which was controlled by the breakpoints was then added. The events listeners were removed and then added again but the original function was only called if the new property was true.

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