I am using sap.m.Text
to display a status of a task (failed, success, error, etc..) and I want the status keyboard accessible, but keyboard 'tab' press does not read the status.
The text is a rendered inside <span>
tag in DOM, is there anyway to add tabindex="0"
to span while declaration of sap.m.Text
component itself? or is there any other component of OpenUI5 I can use to show the status which is also keyboard accessible? (I also used sap.m.Label
, but not getting accessed by keyboard again.
Thank you.
Elements can be tabbed to if they can receive focus. To determine which OpenUI5 UI controls can receive focus, look at whether:
sap.m.Button
renders an HTML <button>
, which can be focused.tabindex
property.Examples of such controls include Button
, Input
, Link
, and an ObjectAttribute
that is active (i.e. also a link). So you could, for example, use ObjectAttribute
, but then your status will look like a hyperlink. To determine the above, you can, for example, search the OpenUI5 repository online or in your local editor.
If there is no suitable control, you can easily extend one. For example, you can extend sap.m.Text
. This should be a simple extension, as you only need to add tabindex
. Here is an example that is very close to what you'll need to do Extending Input Rendering.