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

Bug: Updating dir on page doesn't consistently update components. #3016

Closed
2 tasks
asangma opened this issue Sep 10, 2021 · 6 comments
Closed
2 tasks

Bug: Updating dir on page doesn't consistently update components. #3016

asangma opened this issue Sep 10, 2021 · 6 comments
Labels
0 - new New issues that need assignment. bug Bug reports for broken functionality. Issues should include a reproduction of the bug.

Comments

@asangma
Copy link
Contributor

asangma commented Sep 10, 2021

Actual Behavior

In the demo pages, when turning the RTL toggle on, components don't consistently re-render. Accordion is a good example.

Expected Behavior

Updating dir should result in a consistent behavior across components.

Reproduction Steps or Sample

  1. view Accordion demo page
  2. toggle RTL

Relevant Info

Version: @esri/calcite-components@<version>

  • CDN
  • NPM package
@asangma asangma added bug Bug reports for broken functionality. Issues should include a reproduction of the bug. 0 - new New issues that need assignment. needs triage Planning workflow - pending design/dev review. labels Sep 10, 2021
@driskull
Copy link
Member

I think this is just #2079

@julio8a
Copy link

julio8a commented Sep 22, 2021

Closing this one. Let's use #2079

@julio8a julio8a closed this as completed Sep 22, 2021
@jcfranco jcfranco removed the needs triage Planning workflow - pending design/dev review. label Sep 22, 2021
@caripizza
Copy link
Contributor

IMO we should remove the RTL switch from the demo page header. It sends the wrong impression- that components will dynamically update their UI and display mirrored after a dir change on the root html tag. Or are we actually saying that "our components programmatically respond to dir changes"?

It really seems like the only true way to test rtl is to add the dir="rtl" attribute to the html tag, and let the saved page reload in development, this will show you the true built-in browser behavior our components are currently relying on for their rtl displays.

@driskull
Copy link
Member

It sends the wrong impression- that components will dynamically update their UI and display mirrored after a dir change on the root html tag.

@caripizza This is the end goal. If we get complaints, we should prioritize removing getElementDir() and using CSS logical properties instead.

@caripizza
Copy link
Contributor

I understand it will help yes, but what is the use case for dynamically responding to dir updates? Is there an app somewhere that's actually asking for this behavior and if so can you specify?

@driskull
Copy link
Member

I'm not sure if anyone is asking for it but it's the best practice for having a component automatically work correctly when the text direction changes. Otherwise we have to rely on a re-render of the component.

Our story should be that we should handle CSS direction changes automatically by using CSS logical properties.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 - new New issues that need assignment. bug Bug reports for broken functionality. Issues should include a reproduction of the bug.
Projects
None yet
Development

No branches or pull requests

5 participants