-
Notifications
You must be signed in to change notification settings - Fork 35
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
Conversation
@@ -47,6 +57,7 @@ | |||
<script> | |||
// https://github.com/storybookjs/storybook/issues/6113#issuecomment-473965255 | |||
function runOnPageChange() { | |||
ECL.autoInit().destroy(); |
There was a problem hiding this comment.
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..
There was a problem hiding this comment.
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 */ |
There was a problem hiding this comment.
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..?
There was a problem hiding this comment.
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..
No description provided.