Blazor Server-如何处理用户比SignalR更快的情况?

发布于 2025-02-06 16:45:00 字数 377 浏览 1 评论 0原文

我有一个复杂的Blazor Server应用程序,并且遇到了用户与表单交互的情况,并且当服务器试图通过SignalR操纵DOM时,用户设法以表单进行其他操作。 当我调试应用程序或在LAN中使用PC时,它可以正常工作,因为它非常快。 但是,当我从手机浏览时,这很明显。

这些情况之一是使用条形码读取器读取条形码。 流量是:

  • 用户扫描条形码到文本框中,
  • 如果确定或不良情况,请验证条形码
  • ,如果用户获取消息,
  • 文本框清除了

会发生的情况是,在对其DOM进行任何渲染之前,用户能够扫描其他条形码。

在我看来,必须在本地使用一些JS完成。

任何解决方案的想法都将不胜

感激 Yaron

I have a complex Blazor server app and I run into situations that user interact with the form and while the server is trying to manipulate the DOM via SignalR, the user manage to do other things in the form.
When I debug the app or using PC in the LAN, it works fine because it is very fast.
But when I browse from cell phone it is noticeable.

One of those situations is reading a barcode using barcode reader.
The flow is:

  • user scan barcode into textbox
  • the barcode is validated
  • if OK or Bad the user gets a message
  • the textbox cleared

What happen is that the user is able to scan other barcode before any render is being done to its DOM.

It seems to me that it has to be done with some JS locally.

Any solutions ideas would be appreciated

Tx
Yaron

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文