-
Notifications
You must be signed in to change notification settings - Fork 461
Closed
Labels
community:contributionIssue will/can be addressed by community contributionIssue will/can be addressed by community contributiondocs:articleAdditions, improvements, or fixes to site articlesAdditions, improvements, or fixes to site articles
Description
Documentation Request
There is no information about how to configure RTL mode in the docs. However, by searching the issues I have found out some information about RTL support. (e.g. #386 and a demo site)
FluentDesignTheme has a Direction property which when is set to LocalizationDirection.RightToLeft has no impact.
Based on this comment, in the aforementioned issue, I have done this:
- Added a simple
jsfile containing a simple dir configuration:
export function switchDirection(dir) {
document.dir = dir;
}- Added these initializations to
OnAfterRenderAsyncof the main layout of the app:
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if(firstRender)
{
_jsModule = await JSRuntime.InvokeAsync<IJSObjectReference>("import",
"./_content/[corresponding assembly]/Layouts/MainLayout.razor.js");
var dir = LocalizationDirection.rtl;
GlobalState.SetDirection(dir);
await Direction.SetValueFor(container, dir.ToAttributeValue());
await _jsModule!.InvokeVoidAsync("switchDirection", dir.ToString());
StateHasChanged();
}
}But the result is a rtl layout with the exactly same issue reported in #386. So there should be a better documentation on this feature which I know implementing it have taken lots of time and effort.
v4.7.2
net8.0
Metadata
Metadata
Assignees
Labels
community:contributionIssue will/can be addressed by community contributionIssue will/can be addressed by community contributiondocs:articleAdditions, improvements, or fixes to site articlesAdditions, improvements, or fixes to site articles