Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11868] MobileWeb: Background Color and BackgroundSelectedColor of a button do not work

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2013-04-04T00:39:27.000+0000
Affected Version/sRelease 2.1.3, Release 2.1.4
Fix Version/sRelease 3.1.0, 2012 Sprint 25, 2012 Sprint 25 JS, 2013 Sprint 07 JS, 2013 Sprint 07, Release 3.2.0
ComponentsMobileWeb
Labelsn/a
ReporterAmuktha Akkinepally
AssigneeChristian Sullivan
Created2012-11-27T22:47:37.000+0000
Updated2013-05-10T09:46:12.000+0000

Description

When a button's Background Color is set it only stays for the first click after that click it just becomes white even if the backgroundSelectedColor is specified. It works fine on Android.
Ti.UI.backgroundColor = 'blue';
var win = Ti.UI.createWindow();

var btn = Titanium.UI.createButton({
	title : "test",
	height : 100,
	width : 200,
	backgroundColor : 'green',
	backgroundSelectedColor : 'red',
});

win.add(btn);

win.open();


Steps to reproduce:

1. Load the app.js 2. Run the app in the mobile web preview in Browser 3. Once the page is loaded, The button is green 4. Click on the button. 5. It loses green color and never takes black color (backgroundSelectedColor) 6. Now try running it on the android emulator Expected Result: It should show up the black color when clicked on it. like on Android. Actual Result: It does not behave similar to android. If the background color is only supposed to work this way (only stay till the first click), then there should not be a backgroundColor property for buttons on mobileWeb similar to iOS.

Comments

  1. Christian Sullivan 2012-12-04

    Pull Request https://github.com/appcelerator/titanium_mobile/pull/3517
  2. Olga Romero 2013-02-28

    This issue still present. In master the button does not change color at all, it set green and stays green. It is impossible to see, if a button is clicked. Titanium Studio, build: 3.0.2.201302191606 Titanium Studio, build: 3.0.2.GA Titanium Studio, build: 3.1.0.v20130227145654 Mac osx 10.8.2 Mountain Lion Chrome 24.0.13 Safari 6.0.2
  3. Christian Sullivan 2013-03-29

    [MASTER] Pull Request https://github.com/appcelerator/titanium_mobile/pull/4056
  4. Christian Sullivan 2013-04-04

    [3_1_X] Pull Request https://github.com/appcelerator/titanium_mobile/pull/4075
  5. Paras Mishra 2013-05-10

    color is changed on the click on mobileweb preview in browser. Verified using: SDK: 3.1.1.v20130509173053 CLI version : 3.1.0 OS : MAC OSX 10.7.5 Appcelerator Studio, build: 3.1.0.201305092424 XCode : 4.5.1

JSON Source