Skip to content
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

setTimeout in TCustomAttribute causes annoying 'blink' in browser #59

Closed
kaarholt opened this issue Jan 20, 2016 · 6 comments
Closed

setTimeout in TCustomAttribute causes annoying 'blink' in browser #59

kaarholt opened this issue Jan 20, 2016 · 6 comments
Assignees

Comments

@kaarholt
Copy link

My view is first rendered with initial texts, then (one tick later) texts are replaced by i18n texts. This causes a visible 'jump' of content in the browser, because elements might need less or more space.

The reason is the usage of setTimeout in https://github.com/aurelia/i18n/blob/master/src/t.js line 50 and 62. QUESTION: Why are these timeouts there?

Using i18n in text-nodes instead of attributes does not have the setTimeout issue, and would of course be a solution to my problem. Extending the view with BaseI18N also solves the problem because i18n.updateTranslations is called. But it requires a lot of extra setup code for my view-models.

It would be nice if translating via html attributes worked out of the box.

@EisenbergEffect
Copy link
Contributor

@zewa666 I'd like to understand why those setTimeout calls are there too. We definitely don't want to delay things in the binding process that affect rendering since this will cause performance issues and, as mentioned above, UX problems.

@zewa666
Copy link
Member

zewa666 commented Jan 20, 2016

tbh I have absolutely no clue why I needed those timeouts, especially why there is a second one nested below. I remember vaguely there was some timing issue with binding, but maybe that's gone by now. Will have to check that again

@zewa666 zewa666 self-assigned this Jan 20, 2016
@EisenbergEffect
Copy link
Contributor

There may have been a bug in subscribing to the value property of a custom attribute early on. That was fixed though.

@zewa666
Copy link
Member

zewa666 commented Jan 20, 2016

ok, sounds good will try to fix it asap

zewa666 added a commit that referenced this issue Jan 21, 2016
this removes the usage of timeouts inside bind, as they are not
necessary any more

fixes issue #59
@zewa666
Copy link
Member

zewa666 commented Jan 21, 2016

ok seems that it works without using the timeouts. All tests passed and I couldn't find an obvious issue in my test candidates.
This will go online with the next release

@zewa666
Copy link
Member

zewa666 commented Feb 2, 2016

This was released, if you @kaarholt still experience any issues we can reopen this again

@zewa666 zewa666 closed this as completed Feb 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants