Uploaded image for project: 'Appcelerator - INBOX'
  1. Appcelerator - INBOX
  2. AC-4954

'postlayout' event not fired when property "run-on-main-thread" is set to true

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Duplicate
    • Affects Version/s: None
    • Labels:
    • Environment:

      MacOS 10.12.4 - XCode 8.3.2 - Ti SDK 6.0.4.GA - Hyperloop 2.1.0 - iOS10.3

      Description

      If I set

      <property name="run-on-main-thread" type="bool">true</property>
      

      in tiapp.xml then the 'postlayout' event of any view is not fired.

      An alloy test case may be index.js:

      $.win.addEventListener('open', function(e){
          console.log(e);
      });
      $.viewContent.addEventListener('postlayout', function(e){
          console.log('viewContent');
          console.log(e);
      });
      $.label.addEventListener('postlayout', function(e){
          console.log('label');
          console.log(e);
      });
      $.win.addEventListener('postlayout', function(e){
          console.log(e);
      });
      $.win.open();
      

      index.xml:

      <Alloy>
          <Window id="win" backgroundColor="#FFF">
              <View id="viewContent">
                  <Label id="label">Hello, World</Label>
              </View>
          </Window>
      </Alloy>
      

      Expected result when preperty set to TRUE: view all the events log in the console.
      What's happening: only the "open" event is fired.
      If I set the property to FALSE, then all the events are logged.

      This happens with 6.0.4.GA and 6.0.2.GA. I have tested this with sdk 6.1.0.v20170508081747 and works as expected (all events are fired).

        Attachments

          Activity

            People

            • Assignee:
              shossain Shak Hossain
              Reporter:
              inzori Fabian Martinez
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Git Source Code