fix: Prevent shape change after material creation
Disable Shape dropdown on existing materials since changing shape would require completely different dimension properties. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -28,13 +28,17 @@ else
|
|||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label class="form-label">Shape</label>
|
<label class="form-label">Shape</label>
|
||||||
<InputSelect class="form-select" @bind-Value="selectedShape" @bind-Value:after="OnShapeChanged">
|
<InputSelect class="form-select" @bind-Value="selectedShape" @bind-Value:after="OnShapeChanged" disabled="@(!IsNew)">
|
||||||
<option value="">-- Select Shape --</option>
|
<option value="">-- Select Shape --</option>
|
||||||
@foreach (var shape in Enum.GetValues<MaterialShape>())
|
@foreach (var shape in Enum.GetValues<MaterialShape>())
|
||||||
{
|
{
|
||||||
<option value="@shape">@shape.GetDisplayName()</option>
|
<option value="@shape">@shape.GetDisplayName()</option>
|
||||||
}
|
}
|
||||||
</InputSelect>
|
</InputSelect>
|
||||||
|
@if (!IsNew)
|
||||||
|
{
|
||||||
|
<div class="form-text text-muted">Shape cannot be changed after creation.</div>
|
||||||
|
}
|
||||||
<ValidationMessage For="@(() => material.Shape)" />
|
<ValidationMessage For="@(() => material.Shape)" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user