Closed danielpost closed 6 years ago
@danielpost Sorry, but which methods exactly?
I guess he is talking about the javascript part to toggle draggable
@danielpost @jkniest ah alright. Well I won't have a ton of time soon but I just updated the component last week and it's a lot easier to add new methods. So please feel free to make a PR if you'd like - otherwise it may be a bit :)
@drewjbartlett Flickity recently updated to version 2.1.1, and with it came an update to the way enabling and disabling of drag works.
Previously instance.unbindDrag()
and instance.bindDrag()
were the methods for enabling and disabling dragging. This was accessible through your component by this.$refs.flickity.flickity.unbindDrag()
and this.$refs.flickity.flickity.bindDrag()
. This was a valid workaround, which has since stopped functioning.
The current method for toggling the ability to drag is first setting the draggable option instance.options.draggable = true|false
, and then calling the updateDraggable method instance.updateDraggable();
. This method is not available on your version of the plugin, either through your API or through the instance provided.
I have just created a pull request that resolves this issue. I've added two new methods (enableDrag()
and disableDrag()
), and updated Flickity to the latest version.
Would it be possible to add these functions?
https://codepen.io/desandro/pen/adYJEQ/