diff options
| author | alpadev <[email protected]> | 2021-06-16 06:48:23 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-06-16 07:48:23 +0300 |
| commit | d62ba935ef2e1ee97a57b1b75090e50e86e0d140 (patch) | |
| tree | 1232c08d70ad843bdf48d80fba4435d0bd1fddad /js/src | |
| parent | 9485172017868952047da5f188bc13a92ef0435d (diff) | |
| download | bootstrap-d62ba935ef2e1ee97a57b1b75090e50e86e0d140.tar.xz bootstrap-d62ba935ef2e1ee97a57b1b75090e50e86e0d140.zip | |
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
Diffstat (limited to 'js/src')
| -rw-r--r-- | js/src/carousel.js | 9 |
1 files changed, 8 insertions, 1 deletions
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') { |
