Revert MultiLangInput binding to use @bind instead of explicit Value/ValueChanged
This commit is contained in:
@@ -78,7 +78,7 @@
|
||||
<div class="badge badge-primary badge-sm">@(_languages[_activeLang])</div>
|
||||
</h4>
|
||||
</div>
|
||||
<MultiLangInput Value="_names" ValueChanged="OnNamesChanged" ActiveCulture="@_activeLang" HideTabs="true"
|
||||
<MultiLangInput @bind="_names" ActiveCulture="@_activeLang" HideTabs="true"
|
||||
Placeholder="Enter category name in the selected language..." />
|
||||
<ValidationMessage For="@(() => _names)" class="text-error text-sm mt-1" />
|
||||
</div>
|
||||
@@ -89,7 +89,7 @@
|
||||
Description
|
||||
<div class="badge badge-secondary badge-sm">@(_languages[_activeLang])</div>
|
||||
</h4>
|
||||
<MultiLangInput Value="_descriptions" ValueChanged="OnDescriptionsChanged" ActiveCulture="@_activeLang"
|
||||
<MultiLangInput @bind="_descriptions" ActiveCulture="@_activeLang"
|
||||
HideTabs="true" IsTextArea="true"
|
||||
Placeholder="Summarize what this category contains..." />
|
||||
<ValidationMessage For="@(() => _descriptions)" class="text-error text-sm mt-1" />
|
||||
@@ -254,9 +254,6 @@
|
||||
_editContext = new EditContext(category);
|
||||
}
|
||||
|
||||
private void OnNamesChanged(Dictionary<string, string> val) => _names = val;
|
||||
private void OnDescriptionsChanged(Dictionary<string, string> val) => _descriptions = val;
|
||||
|
||||
void SyncTranslations()
|
||||
{
|
||||
category.Translations = _languages.Keys.Select(lang => new CategoryTranslationVM
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
<div class="badge badge-primary badge-sm">@(_languages[_activeLang])</div>
|
||||
</h4>
|
||||
</div>
|
||||
<MultiLangInput Value="_names" ValueChanged="OnNamesChanged" ActiveCulture="@_activeLang" HideTabs="true"
|
||||
<MultiLangInput @bind="_names" ActiveCulture="@_activeLang" HideTabs="true"
|
||||
Placeholder="Enter product name in the selected language..." />
|
||||
<ValidationMessage For="@(() => _names)" class="text-error text-sm mt-1" />
|
||||
</div>
|
||||
@@ -114,7 +114,7 @@
|
||||
Description
|
||||
<div class="badge badge-secondary badge-sm">@(_languages[_activeLang])</div>
|
||||
</h4>
|
||||
<MultiLangInput Value="_descriptions" ValueChanged="OnDescriptionsChanged" ActiveCulture="@_activeLang" HideTabs="true"
|
||||
<MultiLangInput @bind="_descriptions" ActiveCulture="@_activeLang" HideTabs="true"
|
||||
IsTextArea="true" Placeholder="Write a compelling product description..." />
|
||||
<ValidationMessage For="@(() => _descriptions)" class="text-error text-sm mt-1" />
|
||||
</div>
|
||||
@@ -422,9 +422,6 @@
|
||||
_editContext = new EditContext(product);
|
||||
}
|
||||
|
||||
private void OnNamesChanged(Dictionary<string, string> val) => _names = val;
|
||||
private void OnDescriptionsChanged(Dictionary<string, string> val) => _descriptions = val;
|
||||
|
||||
void SyncTranslations()
|
||||
{
|
||||
product.Translations = _languages.Keys.Select(lang => new ProductTranslationVM
|
||||
|
||||
Reference in New Issue
Block a user