Famous / Famous/framework

Strange thenSet behavior

Open
#59 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
394
Forks
62
PR merge metrics
No merged PRs in 30d

Description

Simple animation where node transitions to the left, content changes, and transitions back. This sequence of set/thenSet does not work. Transitioning to the left, back to the right, THEN changing the content DOES work though this is not the desired behavior.

FamousFramework.scene('tutaslabs:test', {
'behaviors': {
'#button': {
content: '[[identity]]',
'origin': [0.5, 0.5],
'align': [0.5, 0.5],
'size': [200, 100],
'position': '[[identity]]',

```
'style': {
'text-align': 'center',
'line-height': '100px',
'font-size': '30px',
'background-color': 'lightblue',
'cursor':'pointer'
}
}
},
'events':{
'#button': {

'click': function($state,$event) {
// this does not work. The first two sets (and the animation) execute then stop. Last transition never
// happens
$state.set('position',[-200,0],{duration: 2000}).thenSet('content',"Was clicked").
thenSet('position',[0,0],{duration: 2000})

// These sets do work. All three sets (and animations) work as coded.
// $state.set('position',[-200,0],{duration: 2000}).thenSet('position',[0,0],{duration: 2000}).
// thenSet('content',"Was clicked")
}

}

},

'states':{
'content': 'Click me',
'position': [0,0]
},

'tree': ''
```

});

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.