bndw / wifi-card

πŸ“Ά Print a QR code for connecting to your WiFi (wificard.io)

Home Page:https://wificard.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ› html direction partially broken on initial load for RTL languages

a-tokyo opened this issue Β· comments

Description:

– After the recent changes to htmlDirection, the initial load of the page no longer respects language direction
Screenshot of broken code:

  • direction_broken-min

Screenshot of working code: (happens if I change language to another language then back to an rtl language)

  • direction_fixed-min

Proposed solution:

– In App.js we need to have an effect that runs on initial load and sets the direction for the whole App, not just settings component

Hi @a-tokyo thanks for reporting this! This was likely introduced in #168

Proposed solution:

– In App.js we need to have an effect that runs on initial load and sets the direction for the whole App, not just settings component

I agree, since App.js is responsible for the state and rendering the children (card, settings) components, that's the right place to do the initial direction setting. Right now both components are getting the majority of their state through the settings prop, so that might be the best place to track the initial rtl state, instead of adding a new direction prop to both components.