mirror of
https://github.com/tabler/tabler.git
synced 2026-10-12 05:06:55 +04:00
Fix tab/tooltip/popover/dropdown/toast init firing too early (#3218)
This commit is contained in:
1 parent
d104e78947
commit
0f6e843977
7 files changed
+62
-42
No files matched your search
@@ -233,6 +233,8 @@ Tabler activates the tab that matches the URL hash on page load, so you can link
|
||||
|
||||
<CodeDocs name="tab-init" file="core/js/src/tab.ts" />
|
||||
|
||||
This runs on `DOMContentLoaded`, so `show.bs.tab` and `shown.bs.tab` for the hash tab fire before any script that itself waits for `DOMContentLoaded`. Add the listener earlier (a plain `<script>`, not one that is deferred or waits for the load event), or read `Tab.getInstance(triggerEl)` after `DOMContentLoaded` to find the tab that was activated.
|
||||
|
||||
## Accessibility
|
||||
|
||||
- Wrap the tabs in an element with `role="tablist"`, give each trigger `role="tab"` and each panel `role="tabpanel"`, and link them with `aria-controls` and `aria-labelledby`.
|
||||
|
||||
Reference in new issue
Block a user