Comments (4)
Looking at @viktorix's example again, that's not actually using the details
tag properly. It's actually still being operated via JavaScript whereas the details
element works by pure HTML. You can tell because the left arrow doesn't change (as it should) while the right arrow does change (when it shouldn't be there at all).
I have now worked out how to do it right; now I have to remember how to make a PR!
from classicpress-v2.
I did a quick test. I swapped <ul>
with <div>
, <li>
with <details>
, and <h3>
with <summary>
. See below.
The main problem is that it uses a template, so changes to this accordion affect all other too.
EDIT: Further examination shows that do_accordion_sections
is only used once for nav menus. So no issues elsewhere.
For reference:
https://nikitahl.com/native-html-accordion
from classicpress-v2.
This is a great idea. On my own sites, I make many custom menus and lists using the details
and summary
elements.
But, while I understand that this was just a quick trial, you can't implement the change like that. You need to keep the ul
and li
elements, and put the details
and summary
elements inside each li
. Then you need to check what the relevant JavaScript is doing, and whether it should even be disabled somehow.
Or you could wrap all the details
elements inside one overarching details
element.
from classicpress-v2.
This would be a nice resource to check against for this: https://www.hassellinclusion.com/blog/accessible-accordions-part-2-using-details-summary/
from classicpress-v2.
Related Issues (20)
- 🐞 ... causes problems with classic-SEO using php 8.1 ... HOT 19
- deprecation
- 🐞 Quick Edit break columns HOT 10
- 🐞 Uncaught Error: Call to undefined function unregister_block_type()
- 💡 WordPress block-related functions list HOT 5
- wp-login not accessible🐞 HOT 4
- ClassicPress plugins showing update from WordPress plugins🐞 HOT 4
- ♿ Accessibility: Better feedback when moving nav menu items HOT 4
- 💡 Add Gravatar generated robot avatars HOT 1
- Improve forms with HTML5 input types HOT 1
- 💡 Enable Client-side Comment Form Validation HOT 1
- Rebuild widgets screen (and equivalent in Customizer) to use details and summary tags HOT 5
- About screen after update still refers to CP being fork of WP 4.9 HOT 2
- ` wp doctor check core-verify-checksums` not working 🐞 HOT 2
- 💡 Add `wp_body_open` hook to included themes HOT 2
- Replace jQuery UI in CP back-end: First Step: Draggable, Droppable, Sortable HOT 2
- 📋 Adding placeholder supports for WPDB implemented in WP 6.2+ HOT 3
- TinyMCE in Text Widget HOT 3
- 🐞 Edit Post in Visual is "blank" and mce-editor button is stacked (one under other) HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from classicpress-v2.