flatnotes icon indicating copy to clipboard operation
flatnotes copied to clipboard

Auto RTL support

Open themedleb opened this issue 3 years ago • 8 comments

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 :sweat_smile:

themedleb avatar Nov 21 '22 15:11 themedleb

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 avatar Nov 22 '22 13:11 dullage

Thank you, very appreciated.

themedleb avatar Nov 22 '22 14:11 themedleb

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 avatar Nov 26 '22 10:11 dullage

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

Either way, thank you for trying :heart: .

themedleb avatar Nov 26 '22 18:11 themedleb

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 avatar Jul 02 '23 16:07 pbogre

@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?

dullage avatar Jul 03 '23 12:07 dullage

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 avatar Jul 03 '23 14:07 pbogre

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.

pbogre avatar Jul 03 '23 14:07 pbogre