Skip to content

Commit ff11a01

Browse files
committed
[Hotfix] Updated tabs slider
Added a validation so if the user is currently typing in a form the tab change doesn't remove the focus from the input element.
1 parent 3a27328 commit ff11a01

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

Dist/WebflowOnly/TabsSlider.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ Webflow.push(function () {
1515

1616
let timeout = tabs.getAttribute("wt-tabSlider-speed") || 5000;
1717
let tabBtns = tabs.querySelector("[wt-tabSlider-element='menu']");
18-
var tb = Array.from(tabBtns.children);
18+
var tb = Array.from(tabBtns.children);
19+
let activeElement = document.activeElement;
1920

2021
const tabLoop = (tm, timeout) => {
2122
tabTimeout = setTimeout(setTabTimeout, timeout, tm); // 5 Second Rotation
@@ -28,6 +29,10 @@ Webflow.push(function () {
2829
} else {
2930
tm.firstChild.click();
3031
}
32+
if(activeElement.nodeName === "INPUT"){
33+
activeElement.focus();
34+
activeElement.dispatchEvent(new KeyboardEvent('keydown', { keyCode: 40}));
35+
}
3136
}
3237

3338
// Fix for Safari

0 commit comments

Comments
 (0)