Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10488] iOS: webView.loading always returns null

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2016-10-24T07:37:46.000+0000
Affected Version/sRelease 2.1.1, Release 3.1.0
Fix Version/sRelease 6.1.0
ComponentsiOS
Labelsapi, community
ReporterSindre Sorhus
AssigneeHans Knöchel
Created2012-08-11T11:57:16.000+0000
Updated2016-11-17T00:11:36.000+0000

Description

Expected

webView returns true if loading, false if not.

Actual

webView always returns null

Testcase

Click around on some links and see that it only reports <null> in Studio.
var win = Ti.UI.createWindow();
var webView = Ti.UI.createWebView({
	url: 'http://appcelerator.com'
});

setInterval(function() {
	Ti.API.log( webView.loading );
}, 500);

webView.addEventListener('beforeload', function() {
		Ti.API.log( webView.loading );
});

webView.addEventListener('load', function() {
		Ti.API.log( webView.loading );
});

win.add( webView );
win.open();

Comments

  1. Sindre Sorhus 2013-03-01

    bump
  2. jithinpv 2013-05-06

    issue reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 iOS iPhone Simulator: iOS SDK version: 6.0
  3. Hans Knöchel 2016-10-18

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/8523 PR (unit-test): https://github.com/appcelerator/titanium-mobile-mocha-suite/pull/5 There was an unexposed and unused "isLoading" method in the view. I changed it to match the property and exposed it to the proxy. Test-case:
       var win = Ti.UI.createWindow();
       var webView = Ti.UI.createWebView({
           url: 'http://appcelerator.com'
       });
       
       Ti.API.log(webView.loading); // false
       
       webView.addEventListener('beforeload', function() {
           Ti.API.log(webView.loading); // false
       });
       
       webView.addEventListener('load', function() {
           Ti.API.log(webView.loading); // true
       });
       
       win.add(webView);
       win.open();
       
  4. Abir Mukherjee 2016-11-17

    Using the following environment: Node Version: 4.5.0 Mac OS: 10.12.1 Appc CLI: 6.0.0 Appc CLI NPM: 4.2.8 Titanium SDK version: 6.1.0.v20161116071014 Appcelerator Studio, build: 4.8.0.201611121409 Xcode 8.1 GM I was able to reproduce the issue with SDK 6.0.0. I created an app using the demo code in the description, and saw that the log messages was showing "null" every 500ms. I tried this on both Simulator and Device. I then tried the code with SDK version 6.1.0.v20161116071014, and found that messages on the console were showing either 0 or 1 (as expected); no "null" outputs were seen. This was tried on Device iOS 10.1.1 and Simulator iOS 10.1.

JSON Source