| @@ -35,17 +35,14 @@ | ||
| 35 | 35 | accordionItem.isOpen = !accordionItem.isOpen; |
| 36 | 36 | } |
| 37 | 37 | }, |
| 38 | 38 | openPanelByHash: () => { |
| 39 | - if (hashHandled || !window.location?.hash?.length) { | |
| 39 | + if (hashHandled) { | |
| 40 | 40 | return; |
| 41 | 41 | } |
| 42 | 42 | const context = getContext(); |
| 43 | 43 | const { id, accordionItems, autoclose } = context; |
| 44 | - const hash = decodeURIComponent( | |
| 45 | - window.location.hash.slice(1) | |
| 46 | - ); | |
| 47 | - const targetElement = window.document.getElementById(hash); | |
| 44 | + const targetElement = document.querySelector(":target"); | |
| 48 | 45 | if (!targetElement) { |
| 49 | 46 | return; |
| 50 | 47 | } |
| 51 | 48 | const panelElement = window.document.querySelector( |