Accessibility: The textInput
component is a div but it should be an input
#285
Labels
enhancement
New feature or request
input semantics
The textInput component has been coded as a
div
withcontentEditable
set totrue
. I am not sure of the design decision behind this but it would be better if the component was aninput
with atype="text"
attribute/value.Source:
deep-chat/component/src/views/chat/input/textInput/textInput.ts
Line 44 in 6f2f4ab
This would allow keyboard users to easily tab to the field and a screen-reader user would be informed that it is a 'textbox'
If that is too tricky, an alternative would be to add the role of
textbox
to the element e.g.This would tell a screen-reader user that the div is being treated as an input, semantically it would become an
input
andtabindex="0"
would allow a user to tab to the element.Marking the input as disabled
Also instead of
inputElement.classList.add('text-input-disabled');
this could haveinputElement.setAttribute('aria-disabled', 'true')
to tell the screen-reader when the input is disabled as the class.text-input-disabled
does not convey this semantically.Labeling the input
If the above code change is done then the screen-reader user will know the input is a textbox but adding an
aria-label
to theinput
(ordiv role="textbox"
if you choose to do that) would help the screen-reader user know what the textbox is asking of them.The above code change could work well, and while it is not ideal to have an
aria-label
and aplaceholder
that are the same it could improve the accessibility slightly for occasions when the textbox is not empty and the placeholder is not visible without incurring any visual changes.The text was updated successfully, but these errors were encountered: