[tw5] Change layout (RTL/LTR) when editing tiddler

Hello,

I’m facing an issue while editing a tiddler where I’m unable to switch between RTL/TLR using the “Control+Shift” shortcut. I have noticed that this problem is resolved when I hide the toolbar, but I haven’t been able to find any solutions to this issue online.

Can anyone suggest a possible solution to fix this issue?

found a possible solution, I’ve modified the copyStyles function in $:/core/modules/editor/engines/framed.js
by adding removeProperty(‘direction’), it is no longer forces the direction to ‘ltr’

FramedEngine.prototype.copyStyles = function() { // Copy all styles $tw.utils.copyStyles(this.dummyTextArea,this.domNode); // Override the ones that should not be set the same as the dummy textarea this.domNode.style.display = “block”; this.domNode.style.width = “100%”; this.domNode.style.margin = “0”; // In Chrome setting -webkit-text-fill-color overrides the placeholder text colour this.domNode.style["-webkit-text-fill-color"] = “currentcolor”; this.domNode.style.removeProperty(‘direction’); /// ← this will remove the direction:ltr from the editor style };

2 Likes

To be seen correctly in Talk. The original post is re-formatted.

found a possible solution, I’ve modified the copyStyles function in $:/core/modules/editor/engines/framed.js
by adding removeProperty('direction'), it is no longer forces the direction to ltr

FramedEngine.prototype.copyStyles = function() {
// Copy all styles
$tw.utils.copyStyles(this.dummyTextArea,this.domNode);
// Override the ones that should not be set the same as the dummy textarea
this.domNode.style.display = "block";
this.domNode.style.width = "100%";
this.domNode.style.margin = "0";
// In Chrome setting -webkit-text-fill-color overrides the placeholder text colour
this.domNode.style["-webkit-text-fill-color"] = "currentcolor";
this.domNode.style.removeProperty('direction'); /// <-- this will remove the direction:ltr from the editor style
};

1 Like

Thanks Amit, Mohammad,

I’ve created a PR with this change, please let me know how it works for you,

Best wishes

Jeremy

2 Likes