Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5225] Slider change event object properties {x,y,globalPoint} are undefined

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2017-06-09T17:07:51.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterTony Lukasavage
AssigneeIngo Muschenetz
Created2011-08-12T07:40:58.000+0000
Updated2017-06-09T17:07:51.000+0000

Description

When the *change* event is fired on a Slider, the *x*, *y*, and *globalPoint* properties are being returned as undefined. Here is a simple example showing the bug, as well as a naive workaround that will allow you to ascertain the relative *x* position of the Slider using its width and current value. Obviously, this workaround only works with a slider whose range is from 0 to 1, but a more robust workaround could use the min and max ranges to create a 0 to 1 multiplier.
var win = Ti.UI.createWindow();
var slider = Ti.UI.createSlider();
slider.addEventListener('change', function(e) {
	Ti.API.info("x:" + e.x + " -- y:" + e.y + " -- globalPoint:" + e.globalPoint);
	Ti.API.info("calculated x:" + e.source.width * e.source.value);
});
win.add(slider);

win.open();

Comments

  1. Paul Dowsett 2011-10-21

    Reassigning tickets, as per Tony Guntharp's request
  2. Lee Morris 2017-06-09

    Closing ticket due to time passed, any problems please open a new ticket.

JSON Source