dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.26k stars 1.76k forks source link

DisplayPromptAsync does not accept Enter Key Press from scanner data read #25932

Open delwarthink opened 2 days ago

delwarthink commented 2 days ago

Description

I've this below code to receive barcode data from scanner. Scanning barcode does not accept Enter key press of the scanner and I've to press OK button to continue. This is very unproductive on business operation. On scanning a barcode DisplayPromptAsync should return the value of the barcode by automatically triggering OK/accept button.

va barcode= await DisplayPromptAsync("Barcode","Scan Barcode","OK","Cancel",initialValue:"");

Steps to Reproduce

  1. Create a simple Maui app.
  2. Add simple DisplayPromptAsync to read scanner data. va barcode= await DisplayPromptAsync("Barcode","Scan Barcode","OK","Cancel",initialValue:"");
  3. Scan a barcode.
  4. Display stays open just displaying the scanned value and does not act on scanner Enter key press \n.

Link to public reproduction project repository

No response

Version with bug

8.0.10 SR3

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

No response

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

delwarthink commented 2 days ago

Hi, I've added the sample project to git.

  1. Please run it on any barcode scanner android device. I used Honeywell CT47.
  2. Click the button which will open a DisplayPromptAsync
  3. Scan a barcode and you'll see DisplayPromptAsync is not accepting scanner Enter key press and stays on screen. You'll have to touch on 'Ok' to get the data, which is unproductive.

https://github.com/delwarthink/DisplayPromptAsync.git