Instead of an isOpen class, why not using aria-expanded="true" (except for <details)?
aria-expanded="true"
<details