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

Auto RTL support #43

Open
themedleb opened this issue Nov 21, 2022 · 8 comments · May be fixed by #85
Open

Auto RTL support #43

themedleb opened this issue Nov 21, 2022 · 8 comments · May be fixed by #85
Labels
enhancement Something that is on the roadmap help needed Help from another contributer would be welcome

Comments

@themedleb
Copy link

Like adding this HTML attribute dir="auto" to the nodes to make them change direction automatically based on the typed character.

Right now, I'm using hackmd.io they don't support auto RTL support though, but at least they support YAML so I can use something like:

---
dir: rtl
---

to make the whole page RTL when needed.

I wish I can help but I only know some basic HTML and CSS 😅

@dullage
Copy link
Owner

dullage commented Nov 22, 2022

This isn't something I'm familiar with but, if it's as simple as it looks, then I'm sure it's something that could be added. I'll take a look.

@dullage dullage added the enhancement Something that is on the roadmap label Nov 22, 2022
@dullage dullage self-assigned this Nov 22, 2022
@themedleb
Copy link
Author

Thank you, very appreciated.

@dullage
Copy link
Owner

dullage commented Nov 26, 2022

I had a play around with this attribute, adding it to a number of different nodes. Unfortunately it didn't seem to have any effect. I'll flag this as 'Help Needed' and perhaps someone with more experience in this area can lend a hand.

@dullage dullage added the help needed Help from another contributer would be welcome label Nov 26, 2022
@dullage dullage removed their assignment Nov 26, 2022
@themedleb
Copy link
Author

It's fine, I think it has to do with the tiptap project.

Either way, thank you for trying ❤️ .

@pbogre
Copy link
Contributor

pbogre commented Jul 2, 2023

I had a play around with this attribute, adding it to a number of different nodes. Unfortunately it didn't seem to have any effect. I'll flag this as 'Help Needed' and perhaps someone with more experience in this area can lend a hand.

i believe it only takes effect for arabic characters, I was able to see it change the direction of a title written in arabic characters

@pbogre pbogre linked a pull request Jul 2, 2023 that will close this issue
@dullage
Copy link
Owner

dullage commented Jul 3, 2023

@pbogre - Thanks for having a stab at this. I can see now that this property is changing the input direction (e.g. the 'Home' key takes you to the right of the text rather than the left) but it isn't changing the text alignment (i.e. the text is still aligned left).

I don't know this for sure as I've never dealt with rtl languages but I can imagine that the alignment is as important as the input direction and so it's giving me pause on merging this change. Any thoughts?

@pbogre
Copy link
Contributor

pbogre commented Jul 3, 2023

You're absolutely right i don't know how I didn't think about that. Honestly I'm not familiar with RTL languages either so I couldn't tell you how important it is to have the alignment be on the right and not just the directionality.

Perhaps someone with more knowledge on the matter could give us some insight, as for aligning the actual text to the right when the direction is rtl i'm not sure how to implement that as the dir=auto attribute is applied to the whole document and not just the elements that require it, and in that case it would just be a matter of also adding float: right to the style.

If someone can come up with a better solution for this then that would definitely solve this, but as of now I think proper directionality is the very least amount of support that flatnotes should offer for RTL languages

@pbogre
Copy link
Contributor

pbogre commented Jul 3, 2023

something that may or may not be worth noting is that in this jfiddle i found you can see the rtl support affecting the alignment of the object only on chromium, while firefox does not affect the alignment. I tested this myself and it is true.

This might be irrelevant to our situation though because I tested the flatnotes version with the dir=auto attribute on chromium as well and the alignment was not getting affected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Something that is on the roadmap help needed Help from another contributer would be welcome
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants