yoast-components icon indicating copy to clipboard operation
yoast-components copied to clipboard

Improve synonyms field accessibility and address some pending CR feedback

Open afercia opened this issue 7 years ago • 1 comments

See #625, #641, and #642.

For better accessibility and consistency, the new Synonyms input field should render a markup which is as close as possible to the Focus keyword input field. Right now, the former uses an aria-label, the latter uses a <label> element, which is beneficial for a11y (can be clicked etc.)

Also the current Focus keyword field in the plugin uses a visually hidden label element.

There are also a few coding review considerations still to address from #625.

afercia avatar Jul 09 '18 13:07 afercia

Also, from #692

Noticed while working on #691

Code in SynonymsInput could be polished a bit, e.g. seems to me there's no need to explicitly check for non-null { explanationText !== null && ( ... and { explanationText && ( ... would be OK.

Also polishing the related default prop and the example in the KeywordExample page where strings don't need brackets e.g. label={ "Synonyms:" } and the showLabel prop has no effect whatsoever.

afercia avatar Aug 06 '18 08:08 afercia