Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26816] [iOS] AccessibilityLabel isn't available in app

GitHub Issuen/a
TypeBug
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsaccessibility, accessibilityLabel, appium, engSchedule, ios, simulator
Reporterjosh.mocek
AssigneeAbir Mukherjee
Created2019-01-03T16:21:26.000+0000
Updated2020-11-23T18:08:12.000+0000

Description

Here is the titanium app: [https://github.com/joshmocekMovista/accessLabelBug](http://example.com) Once you build the app you will click on the elements. If you do this in Android the "Access Label" will change depending on what you click. In iOS it never changes and stays at "Nothing". Here is the 'doClick' function that is a click event on certain elements in the XML:
function doClick(e) {
	// This doesn't give us Accessibility Label not sure if this is a problem
	console.info('JSON.stringify(e):\n' + JSON.stringify(e));
	changeIndicatorLabel(String(e.source.accessibilityLabel));
	changeIDLabel(String(e.source.id));
	if (e.source.id == 'view2' || e.source.id == 'heyLabel') alert('You clicked view2 or heyLabel');
}
You will also notice when you build the app that the console in the function returns the object 'e', but it is missing the 'accessibilityLabel' property.

Attachments

FileDateSize
index.js2019-01-03T16:17:16.000+0000796
index.tss2019-01-03T16:17:16.000+0000212
index.xml2019-01-03T16:17:16.000+00001324
Screen Shot 2019-01-21 at 1.15.46 PM.png2019-01-21T19:17:45.000+0000113656
Screen Shot 2019-01-28 at 2.06.19 PM.png2019-01-28T11:15:50.000+000039157
tiapp.xml2019-01-03T16:17:16.000+00004230

Comments

  1. Rakhi Mitro 2019-01-10

    Hello, Thanks for sharing with us. What's your Xcode version? It would be helpful if you can share the console logs here for better investigation.
  2. josh.mocek 2019-01-10

    I have 9 and 10 ImageView:
       {
       "x":35.5,
       "y":24.5,
       "bubbles":true,
       "type":"click",
       "source":{
       "animating":false,
       "paused":false,
       "reverse":false,
       "stopped":true,
       "autorotate":true,
       "duration":200,
       "horizontalWrap":true,
       "visible":true,
       "touchEnabled":true,
       "width":50,
       "height":50,
       "image":"/images/myimage.png",
       "id":"scrollimage",
       "top":0
       },
       "cancelBubble":false
       }
       
    Hello, World:
       {
       "x":60.5,
       "y":24.5,
       "bubbles":true,
       "type":"click",
       "source":{
       "horizontalWrap":true,
       "visible":true,
       "touchEnabled":true,
       "height":50,
       "color":"#000",
       "id":"label1",
       "width":200,
       "text":"Hello, World",
       "top":10
       },
       "cancelBubble":false
       }
       
    Hey
       {"x":61.5,"y":12.5,"bubbles":true,"type":"click","source":{"horizontalWrap":true,"visible":true,"touchEnabled":true,"color":"#000","id":"labelInView","width":"SIZE","height":"SIZE","text":"Label in View"},"cancelBubble":false}
       
  3. Rakhi Mitro 2019-01-13

    Thanks for providing this. We are working on this. For testing purpose, can you please run the following code and let us know how it goes. Double-press on the label to see the output.
       var window = Ti.UI.createWindow({
           backgroundColor: 'white'
       });
        
       var scroll1 = Ti.UI.createScrollView({
           backgroundColor : 'red',
           accessibilityLabel : 'This is ScrollView1',
           accessibilityValue : 'Value1',
           accessibilityHint : 'hint 1',
           height : 200,
           top : 0
       });
       var label1 = Ti.UI.createLabel({
           text : 'Label Text',
           accessibilityLabel : 'Label on first Scrollview'
       });
       scroll1.add(label1);
        
       window.add(scroll1);
        
       window.open();
       
  4. josh.mocek 2019-01-15

    There is no click event in the code you gave me so I don't get anything. If I add it to the code I get this:
       {
         "x":1.5,
         "y":15,
         "bubbles":true,
         "type":"click",
         "source":{
           "horizontalWrap":true,
           "visible":true,
           "touchEnabled":true,
           "text":"Label Text"
         },
         "cancelBubble":false
       }
       
    Here is the code I used:
       var window = Ti.UI.createWindow({
       	backgroundColor: 'white'
       });
       
       var scroll1 = Ti.UI.createScrollView({
       	backgroundColor: 'red',
       	accessibilityLabel: 'This is ScrollView1',
       	accessibilityValue: 'Value1',
       	accessibilityHint: 'hint 1',
       	height: 200,
       	top: 0
       });
       var label1 = Ti.UI.createLabel({
       	text: 'Label Text',
       	accessibilityLabel: 'Label on first Scrollview',
       });
       label1.addEventListener('click', function(e) {
       	console.info('JSON.stringify(e):\n' + JSON.stringify(e));
       });
       scroll1.add(label1);
       window.add(scroll1);
       window.open();
       
  5. Rakhi Mitro 2019-01-21

    Can you please try the following: To enable Accessibility Inspector on iOS simulator: Open Settings on the simulator. Click General, then Accessibility. Switch Accessibility Inspector to on. Please test again and let us know how it goes, For details please visit this [link](https://docs.axway.com/bundle/Titanium_SDK_allOS_en/page/accessibility.html).
  6. josh.mocek 2019-01-21

    No, it did not show anything. !Screen Shot 2019-01-21 at 1.15.46 PM.png|thumbnail!
  7. Rakhi Mitro 2019-01-22

    Thanks for your feedback. Did you apply all the steps accordingly from [here](https://docs.axway.com/bundle/Titanium_SDK_allOS_en/page/accessibility.html?)?
  8. josh.mocek 2019-01-24

    Yes

JSON Source