We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Just want to share this feature to get tabs or pills active after refresh the page. Maybe you will build-in it.
const pillsTab = document.querySelector('#pills-tab'); const pills = pillsTab.querySelectorAll('a[data-bs-toggle="pill"]'); pills.forEach(pill => { pill.addEventListener('shown.bs.tab', (event) => { const { target } = event; const { id: targetId } = target; savePillId(targetId); }); }); const savePillId = (selector) => { localStorage.setItem('activePillId', selector); }; const getPillId = () => { const activePillId = localStorage.getItem('activePillId'); // if local storage item is null, show default tab if (!activePillId) return; // call 'show' function const someTabTriggerEl = document.querySelector(`#${activePillId}`) const tab = new bootstrap.Tab(someTabTriggerEl); tab.show(); }; // get pill id on load getPillId();
Source: https://codepen.io/yaroslav-trach/pen/wvyrJJx?editors=1111
The text was updated successfully, but these errors were encountered:
anitaparmar26
No branches or pull requests
Just want to share this feature to get tabs or pills active after refresh the page. Maybe you will build-in it.
Source: https://codepen.io/yaroslav-trach/pen/wvyrJJx?editors=1111
The text was updated successfully, but these errors were encountered: