From b9e351215a7800fedd8985fdf413548dacf990ee Mon Sep 17 00:00:00 2001 From: Sivasish Praharaj Date: Mon, 22 Jan 2024 11:15:37 +0530 Subject: [PATCH] Sivasish48: Issue #39287 Replacing the "show" method with a modified version and Introduced a small delay before triggering the 'Offcanvas' Modifying the 'show' method with 'Offcanvas' class and creating a small delay wuth 'setTimeOut' before triggering the Offcanvas. --- js/src/offcanvas.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/js/src/offcanvas.js b/js/src/offcanvas.js index 8d1feb13bb..dab9750b1a 100644 --- a/js/src/offcanvas.js +++ b/js/src/offcanvas.js @@ -102,7 +102,11 @@ class Offcanvas extends BaseComponent { } this._isShown = true - this._backdrop.show() + this._element.classList.add("offcanvas-end") // Adding the class 'offcanvas-end' here + + const showOffcanvas = ()=>{ + this._backdrop.show() + if (!this._config.scroll) { new ScrollBarHelper().hide() @@ -123,8 +127,12 @@ class Offcanvas extends BaseComponent { } this._queueCallback(completeCallBack, this._element, true) + } + // calling a setTimeout to introduce a small delay triggering Offcanvas + setTimeout(showOffcanvas,50) // Adjust the delay as needed +} hide() { if (!this._isShown) { return