From d62ba935ef2e1ee97a57b1b75090e50e86e0d140 Mon Sep 17 00:00:00 2001 From: alpadev <2838324+alpadev@users.noreply.github.com> Date: Wed, 16 Jun 2021 06:48:23 +0200 Subject: Fix carousel buttons (#34266) * test(carousel): add test to check if next/prev button work as intended * fix(carousel): merge passed config with instance config in carouselInterface --- js/src/carousel.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'js/src') diff --git a/js/src/carousel.js b/js/src/carousel.js index a956ebc8b..fa401535a 100644 --- a/js/src/carousel.js +++ b/js/src/carousel.js @@ -498,7 +498,14 @@ class Carousel extends BaseComponent { static carouselInterface(element, config) { const data = Carousel.getOrCreateInstance(element, config) - const { _config } = data + let { _config } = data + if (typeof config === 'object') { + _config = { + ..._config, + ...config + } + } + const action = typeof config === 'string' ? config : _config.slide if (typeof config === 'number') { -- cgit v1.2.3