Description
openedon Dec 3, 2018
Splitting this out from #12309 (comment)
#12309 introduces the ability for developers to add links in the More menu. Also link with an incomplete URL fragment identifier, i.e. href="#"
can be added. Unfortunately, this is a largely adopted bad practice: UI controls that behave like buttons should be <button>
elements. Links should trigger navigation. For WordPress core, see https://core.trac.wordpress.org/ticket/26504 which is an a11y "blessed task".
Also links that have a fragment identifier e.g. href="#some-id-in-the-page"
but then the referenced ID doesn't exist, should not be allowed.
It would be great to explore a way to check the passed url value. The first case should be simple to address: if the URL value is just #
then an error should be thrown.
Not sure how to address programmatically the second case. Maybe automated accessibility tests could help in this case.