-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting placeholder for a component is broken #12514
Comments
@quaertym I think you should not be using the import Ember from 'ember';
Ember.STRINGS = {
'_hello_': 'Bonjour'
}
export default Ember.Component.extend({
tagName:'input',
attributeBindings: ['prompt:placeholder'],
prompt: Ember.computed('placeholder', function() {
let prompt = this.get('placeholder');
return Ember.String.loc(prompt);
})
}); |
@pixelhandler This fixes it but does not explain why it suddenly broke. |
As @pixelhandler points out, using a CP is correct, as there are several issues in not doing so:
That being said, this does appear to indicate an issue. I believe the issue is a collision between @rwjblue any thing come to mind? |
Yes, I do believe this is a bug (but the OP should still change to a CP as it is better for this sort of thing). The bug is basically that we do not seem to use changes to things in |
Ya this is likely the issue. Although I would prefer users not use this functionality, this does seem like a bug. |
Likely related to #11480 |
Issue in updating attributeBindings value after v1.12.x. here is the twiddle. Earlier in 1.12.x, we have updated the attributeBindings regardless of consumer mentioning the attribute and this is not the case from v1.13+. It is broken here. cc @rwjblue |
Closing in favor of #11480. This workaround seems to work in your case as well. Thank you for reporting! |
@Serabe yeah that workaround would work for normal component, but not for the extended one. For e.g: I have a component, where I have extended Textarea component. In this case, unfortunately the workaround won't work(attributeBindings for rows). At the moment, I directly update the DOM attribute, even though it's a bad way. Any suggestions..?? |
What I try to do is to localize placeholder text for a component in its
willInsertElement
hook by passing localization key as a parameter to the component. Same code was working with1.12.x
but it is broken in1.13.x
and2.x.x
versions. This twiddle demonstrates the problem. Is this a bug? Or am I doing something wrong?The text was updated successfully, but these errors were encountered: