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

replace interpolated text with [innerText] #274

Merged
merged 1 commit into from
Nov 3, 2017
Merged

replace interpolated text with [innerText] #274

merged 1 commit into from
Nov 3, 2017

Conversation

chrxs
Copy link
Contributor

@chrxs chrxs commented Oct 31, 2017

We have an issue where the date picker is translated to german, but then the users browser gives them the option to translate the page. when the user does this and translates the page text values (month name for example) no long updates.
Using [innerText] solves this.

From this StackOverflow answer it seems

"There is no technical reason to prefer one form to the other."

@vlio20
Copy link
Owner

vlio20 commented Oct 31, 2017

The question is why it solves it. Please open an issue. And submit your PR to the next branch

@vlio20
Copy link
Owner

vlio20 commented Oct 31, 2017

@chrxs, I would like also to see how other date pickers are behaving in such examples. Please provide some examples.

@chrxs
Copy link
Contributor Author

chrxs commented Nov 1, 2017

Hi @vlio20 I have created an issue #277 where I've written all the details of the issue, and screen capture.

I haven't seen or used any other date pickers, and don't have time to see if they behave the same.
I do know that our entire app suffered from this problem and we have since replaced all

<div>{{value}}</div>

to:

<div [innerText]="value"></div>

It has resolved the issue with no side effects

@@ -183,11 +183,11 @@ describe('dpDayPicker dayPicker', () => {

it('should check the first day of the week', () => {
page.dayPickerInput.click();
expect(page.weekDayNames.getText()).toEqual(['Sun Mon Tue Wed Thu Fri Sat']);
expect(page.weekDayNames.getText()).toEqual(['SunMonTueWedThuFriSat']);
Copy link
Owner

@vlio20 vlio20 Nov 1, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did it effect this? why the spaces are gone?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems there was whitespace inside the tags before, like:

<span>
  November
</span>

which now becomes:

<span>November</span>

@vlio20
Copy link
Owner

vlio20 commented Nov 2, 2017

@chrxs, you should make the PR from and to the next branch

We have an issue where the date picker is translated to german, but then the users browser gives them the option to translate the page. when the user does this and translates the page text values (month name for example) no long updates.
Using [innerText] solves this.
@chrxs chrxs changed the base branch from master to next November 2, 2017 19:40
@vlio20 vlio20 merged commit 75fae19 into vlio20:next Nov 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants