Stop form submit when using scanner

My app uses an external QR scanner to read some codes. Everything is working correctly. However, everytime the scanner reads something the form is submitting which is not something I want to happen. Field should only display the value and thats it.

Anyways I can control this behaviour
Solution
you could try something like this?

TextInput::make('qr_code')
    ->label('Scan QR Code')
    ->autofocus()
    ->extraAttributes([
        'x-on:keydown.enter.prevent' => '',
    ])
Was this page helpful?