Skip to content

Commit

Permalink
feat: autofocus barcode field in more situations (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
GoodOldJack12 authored Feb 28, 2024
1 parent caa407f commit 294d890
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions GrocyScanner.Service/Pages/Scanner.razor
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
@bind-Value="ScannerMode"
Color="Color.Primary"
CheckMark
FixedContent>
FixedContent
@onclick="() => barcodeInputTextRef.FocusAsync()">
<MudToggleItem SelectedIcon="@Icons.Material.Filled.ShoppingCart" Value="@ScannerMode.Purchase" Text="Purchase"/>
<MudToggleItem SelectedIcon="@Icons.Material.Filled.Restaurant" Value="@ScannerMode.Consume" Text="Consume"/>
<MudToggleItem SelectedIcon="@Icons.Material.Filled.AutoDelete" Value="@ScannerMode.ConsumeSpoiled" Text="Consume (spoiled)"/>
Expand All @@ -39,7 +40,8 @@
Variant="Variant.Filled"
Required="true"
RequiredError="'Barcode is required'"
TextChanged="OnInternalValueChanged">
TextChanged="OnInternalValueChanged"
AutoFocus="true">
</MudTextField>
</div>

Expand Down

0 comments on commit 294d890

Please sign in to comment.