@gcastre I think the behavior you described is related to how I18N works. With a t custom attribute, probably the whole innerHTML is updated (by service from I18N library) while with value converter or binding behavior, only the text content is updated.
that is true. In most scenarios the original DOM element is recreated and replaced. This is partially due to avoid replacement issues (prepend/append, attributes) and due to this approach not really being the best for large tables. In such cases typically you'd want to stick with BindingBehavior or even better the T ValueConverter, if your locales are not going to change at runtime, due to smaller overhead. Preferably also with one-time bindings if the bound source is not going to change.
As discussed on the gitter with @zewa666
I'm submitting a bug report
Please tell us about your environment:
Operating System: Windows 10
Node Version: 10.15.3
NPM Version: 6.9.0
JSPM OR Webpack AND Version webpack 4.30.0
Browser: Chrome 73.0.3683.103
Language: ESNext
Current behavior:
Using the T custom attribute on a
Expected/desired behavior:
Only the
Here is a sample based on a new project from the cli: https://github.com/gcastre/au-i18n
I used the paint flashing in chrome to see the issue.
@gcastre I think the behavior you described is related to how I18N works. With a
t
custom attribute, probably the whole innerHTML is updated (by service from I18N library) while with value converter or binding behavior, only the text content is updated.that is true. In most scenarios the original DOM element is recreated and replaced. This is partially due to avoid replacement issues (prepend/append, attributes) and due to this approach not really being the best for large tables. In such cases typically you'd want to stick with BindingBehavior or even better the T ValueConverter, if your locales are not going to change at runtime, due to smaller overhead. Preferably also with one-time bindings if the bound source is not going to change.
Ok thank you for your response. May I suggest to add a warning about that in the documentation ?
Good idea. Created a PR for the docs, please have a quick review @gcastre.