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

feat(datepicker): Adapt JS for RTL support - FRONT-3595 #2396

Merged
merged 7 commits into from Apr 21, 2022

Conversation

papegaill
Copy link
Contributor

No description provided.

@github-actions
Copy link

github-actions bot commented Apr 21, 2022

@@ -47,6 +57,7 @@
<script>
// https://github.com/storybookjs/storybook/issues/6113#issuecomment-473965255
function runOnPageChange() {
ECL.autoInit().destroy();
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really need to destroy everything on each click on in a different story..? I don't necessarily see the need for this, but i might not consider something..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes first of all to lighten the global ECL.components array which grows with each component instantiation. And also because I noticed that by switching rtl and navigate between the stories, if the destroy is not done it creates problems..

@@ -1,4 +1,4 @@
/* eslint-disable no-console */
/* eslint-disable no-plusplus */
Copy link
Contributor

Choose a reason for hiding this comment

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

Why adding an exclusion and not changing the syntax to prevent the error..? What was wrong with the previous forEach, by the way..?

Copy link
Contributor Author

@papegaill papegaill Apr 21, 2022

Choose a reason for hiding this comment

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

The previous foreach was wrong, removing elements from the array during the loop misleads the final result.
it's therefore necessary to loop backwards to avoid any breaking..

@planctus planctus merged commit d354e09 into v3-dev Apr 21, 2022
@planctus planctus deleted the feat/FRONT-3595-rtl branch April 21, 2022 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants