-
Notifications
You must be signed in to change notification settings - Fork 337
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
Text direction by default #49
Comments
i find this method but its not working |
That method only works on Flutter Web, and should only be used internally (the documentation says this as well). If you see the implementation of text direction, I have: if (kIsWeb) {
widget.controller
.changeTextDirection(index == 0 ? 'ltr' : 'rtl');
} else {
await widget.controller.editorController!
.evaluateJavascript(source: """
var s=document.getSelection();
if(s==''){
document.execCommand("insertHTML", false, "<p dir='${index == 0 ? "ltr" : "rtl"}'></p>");
}else{
document.execCommand("insertHTML", false, "<div dir='${index == 0 ? "ltr" : "rtl"}'>"+ document.getSelection()+"</div>");
}
""");
} So on mobile there is different code than web. To change the text direction permanently on startup, use HtmlEditor(
callbacks: Callbacks(
onInit: () {
controller.editorController!.evaluateJavascript(source: "\$('div.note-editable').attr('dir', 'rtl');");
}
)
) Hope it helps. |
Closing this issue for now, let me know if you have further questions. |
Type question here.
how can change direction to RTL by default?
and how can change language on values?
thanks
The text was updated successfully, but these errors were encountered: