Skip to content

Instantly share code, notes, and snippets.

@3AHAT0P
Last active December 10, 2016 16:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save 3AHAT0P/82071c2cb3c534a031030da0857476b2 to your computer and use it in GitHub Desktop.
Save 3AHAT0P/82071c2cb3c534a031030da0857476b2 to your computer and use it in GitHub Desktop.
Ember 2.10.0 - Bug with inline styles
import Ember from 'ember';
export default Ember.Component.extend({
attributeBindings: 'style'.w(),
style: '',
init() {
this._super(...arguments);
Ember.run.later(this, () => {
this.set('isVisible', true);
}, 5000);
},
didInsertElement() {
this.set('style', 'color: red;');
}
});
import Ember from 'ember';
export default Ember.Component.extend({
isVisible: false,
attributeBindings: 'style'.w(),
style: '',
init() {
this._super(...arguments);
Ember.run.later(this, () => {
this.set('isVisible', true);
}, 5000);
},
didInsertElement() {
this.set('style', 'color: red;');
}
});
import Ember from 'ember';
export default Ember.Component.extend({
attributeBindings: 'style'.w(),
style: '',
init() {
this._super(...arguments);
Ember.run.later(this, () => {
this.set('isVisible', false);
}, 5000);
Ember.run.later(this, () => {
this.set('isVisible', true);
}, 10000);
},
didInsertElement() {
this.set('style', 'color: red;');
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
textAreaVisible: true,
actions: {
toggleVisibilityTextArea() {
this.toggleProperty('textAreaVisible');
}
}
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
<br>
<br>
<div>{{test-one}}</div>
<div>{{test-two}}</div>
<div>{{test-three}}</div>
<div>{{textarea isVisible=textAreaVisible placeholder='resize me'}}</div>
<button type='button' {{action 'toggleVisibilityTextArea'}}> Toggle visibility TextArea</button>
{
"version": "0.10.6",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "release",
"ember-data": "2.9.0",
"ember-template-compiler": "release",
"ember-testing": "release"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment