2 Dec 2011 10:51 AM #1
Animations z-index seems wrong
This pattern seems to exist in 1.x and 2.x for animations:
curZ = el.getStyle('z-index') == 'auto' ? 0 : el.getStyle('z-index'),
... later on... some math on curZ
zIndex = curZ + 1
If I'm using z-index to achieve some interesting effects then this makes it very hard to work with. If I set z-index: 100, then rather than the animation setting it to 101 (which seems reasonable), it get's set to 1001.
Perhaps the pattern to set curZ in all the animations should be:
curZ = el.getStyle('z-index') == 'auto' ? 0 : parseInt(el.getStyle('z-index'))
2 Dec 2011 12:09 PM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
Can I get a test case to reproduce?Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services firstname.lastname@example.org
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.
3 Dec 2011 3:24 PM #3
4 Nov 2015 7:05 AM #4
The problem is around line 379 of http://docs.sencha.com/touch/2.4/2.4....html#Ext-Anim: 'zIndex = currentZIndex + 1'
If zIndex is set as el.getStyle('z-index') it is set as the string '1' and string math occurs causing the z-index to grow from '1' to '11' to '111'. If operating on the same component it only takes 7 animations to reach the max allowed z-index (2147483647)...2^31.
I attached a fiddle that replicates the problem...if someone can figure out how to embed it that would be a welcome edit.